Convert Text to Hex
Convert text to hex (UTF-8) and back with per-character breakdown. 4 separator formats. Free, offline, client-side, instant, secure.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Convert text to hex (and back) using proper UTF-8 encoding via the browser's TextEncoder. Per-character grid shows codepoint, byte count, hex, and binary for every input character. Emoji and non-ASCII characters expand into their multi-byte UTF-8 sequences visibly.
Per-character breakdown
How to Use Convert Text to Hex
- Type or paste text. ASCII letters work, but so do emoji 😀, accented é, CJK 你好, Arabic مرحبا, math symbols ∑. UTF-8 encoding via
TextEncoderproduces correct multi-byte sequences for every codepoint. - Choose a separator. Space-separated (
48 65 6C 6C 6F) matches hex dumps. Comma for CSV-style data. Continuous (no separator) for raw byte strings. 0x-prefixed (0x48 0x65) for pasting straight into C, Rust, or Python source. - Toggle uppercase or lowercase. Default uppercase matches most hex dump conventions (
hexdump -C, Windows tools). Lowercase is common in C/Rust source. Mathematically identical bytes; the choice is stylistic. - Read the per-character grid. One row per Unicode codepoint showing the codepoint number (
U+0041), the UTF-8 byte count, hex bytes, and binary bytes. Multi-byte characters jump out:éshows 2 bytes, 😀 shows 4. - Swap for reverse. ⇄ flips to Hex → Text. The parser accepts
48 65 6C 6C 6F,0x48 0x65,48656C6C6F,48,65- strips prefixes and separators, validates pairs, decodes strict UTF-8. - Batch mode. Multiple lines = TSV with Input / Hex / Bytes / Chars columns. Download as
.tsvopens in Excel/Sheets with proper columns. Errors get an ERROR row so one bad line doesn't break the batch. - Stats summarize the encoding. Chars vs bytes vs multi-byte count tells you instantly whether your input has non-ASCII.
chars=5 · bytes=5= pure ASCII;chars=7 · bytes=11 · multi-byte=2= 2 emoji/accented characters expanded the byte count.
Frequently Asked Questions
Does it handle emoji correctly?
Yes. The tool iterates Unicode codepoints (using for…of) so surrogate pairs for high codepoints stay together. 😀 (U+1F600) encodes as the 4-byte UTF-8 sequence F0 9F 98 80, shown as one row in the grid. Older converters use charCodeAt which returns UTF-16 code units and produces wrong hex for anything above U+007F.
Can I convert hex back to text?
Yes – click Swap. The reverse parser is lenient about input formatting: 48 65 6C 6C 6F, 0x48 0x65 0x6C 0x6C 0x6F, 48,65,6C,6C,6F, and 48656C6C6F all decode to Hello. Odd-digit input gives “Hex must have even digit count”; non-hex characters give “Invalid hex digit ‘X’ at position N”.
What does strict UTF-8 decoding mean?
The decoder uses {fatal: true} mode, which throws when bytes don’t form valid UTF-8 – for example a lone continuation byte 80 with no lead byte, or an overlong encoding. Non-strict decoders silently substitute the U+FFFD replacement character ("�") and hide the problem. Strict mode surfaces data corruption instead.
Which separator should I use?
Match your destination. Hex dumps: space. CSV imports: comma. Raw byte strings: continuous (no separator). C/C++/Rust source literals: 0x-prefixed, paste straight as {0x48, 0x65, 0x6C, 0x6C, 0x6F}. The underlying bytes are identical; only display differs.
Uppercase vs lowercase – does it matter?
Mathematically no – 4F and 4f are the same byte (79). The choice is stylistic. Unix tools (od, xxd) default to lowercase. Windows hex editors and macOS Hex Fiend default to uppercase. C/Rust source typically uses lowercase. Pick whichever your codebase uses.
What’s the input size limit?
200,000 characters. Beyond that the per-character grid renders too slowly (each row is a DOM node). Hit the cap and you get a specific error message. The grid itself caps at 256 displayed rows with a “… N more” note, but conversion still processes the full input.
How does the grid show whitespace?
The Char column substitutes visible glyphs so rows aren’t blank: space → · (middle dot), newline → ↵, tab → →. The actual encoded bytes (20, 0A, 09) appear correctly in the Hex and Binary columns. Useful when auditing what’s actually in your text.
Is there a difference between this and the “String to Hex” tool?
Functionally they’re equivalent – both convert text to UTF-8 hex and back with per-character analysis. They exist as separate URLs because “string” and “text” are different SEO keywords people search for, even though they mean the same thing in this context.
Is my input uploaded anywhere?
No. All UTF-8 encoding, hex formatting, decoding, and TSV emission run in your browser using TextEncoder/TextDecoder. Open DevTools → Network and confirm zero requests – even when you Convert or Download. Safe for sensitive text, credentials, or anything you’d rather not send to a third-party converter.
Does it work offline?
Yes. Total bundle is about 18 KB. Load once, disconnect, keep using. Pure local computation – no fonts to fetch, no analytics, no API. Useful for offline debugging, airgapped environments, or when you don’t trust the network you’re on.
Related Tools
Convert Hex to Text →
Decode hex or hex-dump output (xxd, hexdump -C, Wireshark) to UTF-8 text. Non-printable handling,…
Add Hex Numbers →
Add Hex Numbers instantly. Free, offline, client-side tool that outputs results in both hex…
ASCII to Hex Converter →
Convert ASCII to Hex - code points or UTF-8 bytes, space/comma/0x-prefixed, uppercase or lowercase.…
Base32 to Hex Converter →
Base32 to Hex Converter - pick separator, case, and prefix. Free, client-side, instant, offline,…
Base58 to Hex Converter →
Decode Bitcoin, Ripple, or Flickr Base58 strings to hex - with separator, case, and…
Base64 to Hex Decoder →
Decode Base64 to hex bytes - URL-safe variant, separator options, uppercase toggle, UTF-8 aware.…
BCD to Hex Converter →
Convert packed BCD to hexadecimal - decimal-value or nibble mode, BigInt precision, COMP-3 sign.…
Convert Decimal to Hex →
Convert decimal numbers to hexadecimal instantly, individually or in bulk. Free, client-side converter with…
Convert Gray Code to Hex →
Decode Gray code (reflected binary) to hex, decimal, or binary. Accepts binary or hex-packed…
Convert Hex to ASCII →
Decode hexadecimal bytes to ASCII text. Auto-detect separators, handle non-printable bytes four ways, batch…
Convert Hex to BCD →
Convert hex to Binary Coded Decimal - packed, unpacked, or COMP-3 with sign nibble.…
Convert Hex to Binary →
Convert hex to binary with nibble-accurate bit widths. 5 grouping modes, 0b prefix toggle,…