Hex to String / String to Hex
Free online hex and string converter. Space / 0x / comma separators, upper/lowercase toggle, UTF-8 aware, with clear validation of invalid hex input.
Runs locally · data never uploaded
Advertisement
How to use
What it does
Hexadecimal (hex) represents each byte as two hex digits. It is handy for inspecting binary data, verifying files and debugging protocols. This tool parses text as UTF-8, so non-ASCII characters like Chinese are first turned into their UTF-8 bytes before being shown as hex.
Options:
- Separator: none, space,
0xprefix (e.g.0x4f 0x60), or comma. - Uppercase: toggle between
4fand4F. - Direction: string → hex, or hex → string.
Decoding (hex → string) automatically strips spaces, commas and 0x prefixes and validates the input: the length must be even and only 0-9 a-f A-F are allowed. Invalid input produces a clear, readable error.
Example
Convert Hello to hex (no separator, lowercase):
48656c6c6fConvert 你好 to hex (UTF-8, space-separated):
e4 bd a0 e5 a5 bdCommon uses
- Comparing two files byte for byte
- Inspecting the real bytes of a character when debugging encoding/mojibake
- Building or parsing binary protocols and hash inputs
FAQ
Q1.Why does Chinese turn into so many hex digits?
Chinese characters usually take 3 bytes in UTF-8, and each byte is two hex digits, so one character becomes 6 hex digits (e.g. "你" → e4 bd a0). This is standard and reversible.
Q2.What does "length must be even" mean?
Every two hex characters represent one byte, so the total number of characters must be even. If one is missing (e.g. `48656c6c6`), the input is truncated or has a stray character — check the end.
Q3.Can hex include 0x or spaces?
Yes. Decoding ignores `0x` prefixes, spaces and commas, keeping only valid hex characters, so `0x48 0x65` and `4865` are equivalent.
Q4.Is my data uploaded?
No. All conversion happens locally in your browser and works offline after a refresh.
Advertisement
Related tools
Unicode Escape / UnescapeFree online Unicode escape and unescape. Supports \u, %u andBase64 Encode / DecodeFree online Base64 encoder and decoder with full UTF-8 (ChinURL Encoder / DecoderFree online URL encoder and decoder. Choose encodeURIComponeHTML Entity Encode / DecodeFree online HTML entity encoder and decoder. Supports named