Encoding & Number Bases
Hex Content Encoder
Represent selected bytes as pipe-delimited hex groups within text. Choose special characters or all bytes for a content-string fragment.
This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.
Hex Content Encoder replaces selected bytes with hexadecimal groups enclosed in pipe characters. This mixed representation appears in Snort content strings. With Only special chars selected, foo=bar becomes foo|3d|bar.
The result combines unchanged text with pipe-delimited hexadecimal groups. The Convert option controls which bytes become hex.
- Inspect a small mixed ASCII and hexadecimal content example.
- Compare literal text with its pipe-delimited byte representation.
- Prepare a content-string fragment for review in a separate rule-writing workflow.
Instructions
- Enter the text you want to represent as mixed content.
- Choose Convert: Only special chars, Only special chars including spaces, or All chars.
- Choose whether to print spaces between bytes, then review the generated groups.
Example
Input: a=1; b=2
Settings: Convert Only special chars, Print spaces between bytes off
Result: a|3d|1|3b| b|3d|2
Convert Only special chars including spaces also encodes the space. It returns a|3d|1|3b20|b|3d|2.
Limits
- This tool handles content-string fragments. It does not parse or validate complete Snort rules.
- Plain hex without pipe delimiters remains literal text in Hex Content Decoder. Use the separate Hex Decoder for that format.
- The decoder uses permissive matching. Unmatched text can pass through unchanged; a completed result does not certify valid rule syntax.
- A byte sequence does not identify its character encoding. Decimal byte output is not a Unicode code-point list.