Text to Hex — Online Text to Hex Converter

🔒 Runs in your browser — nothing is sent to a server

Text to hex converter that turns any text, password, snippet or paragraph into clean hexadecimal bytes in a single click. Paste English text, a phrase with diacritics, CJK glyphs, Arabic or emoji; pick an output format (space-separated `48 69`, compact `4869`, C-style `\x48\x69` or prefixed `0x48, 0x69`), choose lower or upper case, and switch between UTF-8 (default — handles every Unicode character) and strict 7-bit ASCII. This hex encoder runs 100% inside your browser; your input never leaves your device, nothing is uploaded, logged or sent to any server.

Lowercase is the default in most libraries (Python `binascii`, Node `Buffer`).

Two-pane view: input and output side by side
Copied!

When to use a text to hex converter

Converting text to hex is a daily chore in low-level programming, embedded work, network debugging and CTFs. Hand-feeding bytes into a hex editor, building a fixture for a binary parser test, embedding a magic constant into C source as `\x..\x..`, decoding what the network monitor printed when it captured an ASCII payload, hashing a deterministic string and comparing against a known digest, or simply teaching how UTF-8 widens non-English text — all of these begin with "show me the hex." A trustworthy, browser-local converter means the text never leaves your machine, which matters when the input is a credential or a proprietary protocol field.

How text becomes hexadecimal bytes

Text to hex conversion is a two-step pipeline. First the string is encoded into bytes — UTF-8 (variable-width, 1–4 bytes per character) by default, or ASCII (1 byte per character, 0–127 only) if you pick the ASCII option. The browser `TextEncoder` API runs this step natively. Second, each byte is formatted as a two-digit hexadecimal pair, optionally separated by a space, prefixed with `\x`, or wrapped as `0x…, 0x…`. Reversing the process is exactly the same pipeline backwards: the hex-to-text tool strips the chosen separators, parses each two-digit group into a byte, then runs `TextDecoder` to rebuild the Unicode string.

Examples

Input
Hello
Output
48 65 6c 6c 6f
Text to hex — classic "Hello" with space separator
Input
text to hex
Output
7465787420746f20686578
String to hex — phrase using compact lowercase format
Input
café
Output
63 61 66 c3 a9
Hex encoder — UTF-8 phrase with diacritic (café)
Input
Γεια
Output
ce 93 ce b5 ce b9 ce b1
Convert text to hex — Greek "Γεια" produces 8 UTF-8 bytes

FAQ

How do I convert text to hex?

Paste the text into the input above, pick an output format (space-separated by default) and an encoding (UTF-8 covers every character; ASCII is 7-bit only), then click Convert. The hex encoder turns each character into its byte sequence and emits each byte as a two-digit hexadecimal pair — exactly what most decoders, debuggers and REPLs expect.

What is the hex value of the letter A?

The letter "A" is ASCII 65, which in hexadecimal is `41`. Lowercase "a" is 97 → `61`. Any text to hex converter based on UTF-8 or ASCII produces the same byte for the 95 printable ASCII characters, because UTF-8 is a strict superset of ASCII for code points 0–127.

Is text to hex the same as string to hex?

Yes — `text to hex` and `string to hex` are interchangeable names for the same operation. Some libraries call it `hexlify` (Python `binascii.hexlify`), others `Buffer.from(s).toString("hex")` (Node) or `s.bytes.toHex()` (Swift). The underlying flow is identical: encode the string into bytes, then format every byte as a two-digit hex pair.

Why does my non-English text produce more bytes than characters?

UTF-8 is variable-width. ASCII letters take 1 byte, Latin-1 letters with diacritics (like é) take 2 bytes, most CJK characters take 3, and emoji take 4. The Greek word `Γεια` has 4 letters but encodes to 8 bytes — `ce 93 ce b5 ce b9 ce b1`. Switch to ASCII only for English-only inputs; for anything else keep UTF-8.

Should I use lowercase or uppercase hex?

Lowercase is the default in most libraries (Python `binascii.hexlify`, Node `Buffer.toString("hex")`, Rust `hex::encode`) and is what hash tools like `sha256sum` emit. Uppercase looks more deliberate in printed material and matches Windows-style register dumps. Either is valid hex — just pick whichever your downstream tool consumes and stick to it.

What output format should I pick — space, compact, \x or 0x?

Space-separated `48 69` is the most readable, compact `4869` is the densest and what most hex APIs accept. C-style `\x48\x69` drops straight into a C/C++ string literal. The `0x48, 0x49` prefixed form is what you paste into a JavaScript / Python array initialiser. Pick the format that matches the consumer of the output.

Does this converter handle Unicode, CJK and emoji?

Yes. With UTF-8 selected, the converter first encodes the input into UTF-8 bytes and then formats each byte as hex. `café` becomes 5 bytes (`63 61 66 c3 a9`), `你好` becomes 6 bytes (`e4 bd a0 e5 a5 bd`), and the 😀 emoji becomes 4 bytes (`f0 9f 98 80`). ASCII mode throws an explicit error on any non-ASCII character.

Is it safe to paste sensitive text into this hex encoder?

Yes — the text to hex converter runs entirely in your browser using the Web `TextEncoder` API. Your input and the hex output stay on your machine; nothing is uploaded, logged or cached. Safe for tokens, passphrase fixtures, redaction prototypes and proprietary strings you are about to encode for a binary protocol.

Glossary

Hexadecimal

Hexadecimal (base 16) writes each byte as two characters using digits 0–9 and letters a–f. A byte covers the value range 0–255, which fits in exactly two hex digits (`00`–`ff`). Hex is the lingua franca for displaying byte data because it is twice as compact as binary, exactly aligned to byte boundaries, and lossless for any binary payload.

Hex encoder

A hex encoder is any tool or function that converts text or binary data into a hexadecimal byte string. For text, the encoder first runs the input through a character encoding (UTF-8 by default, ASCII as a strict subset) and then formats every resulting byte as a two-digit hex pair. This page is a hex encoder that runs fully client-side in your browser.

ASCII

ASCII is the 7-bit character set defined by ANSI X3.4 that assigns the integers 0–127 to common English letters, digits and punctuation. Every ASCII character fits in a single byte with a leading zero, so "A" is `41` in both ASCII and UTF-8 hex. A text to hex tool in ASCII mode rejects any character outside that range.

UTF-8

UTF-8 is the variable-width encoding of Unicode used by over 98% of the web. ASCII characters take 1 byte, Latin / Greek / Cyrillic letters with diacritics take 2 bytes, most CJK characters take 3 bytes, and astral characters (emoji, rare scripts) take 4 bytes. This text to hex converter uses UTF-8 by default so every printable Unicode character encodes losslessly.

Hex format conventions

The same byte stream can be displayed as space-separated `48 69`, compact `4869`, C-style `\x48\x69` or prefixed `0x48, 0x69`. None is more "correct" than another — they are interchangeable representations selected to match the consumer. Most APIs accept compact hex; debuggers and printed material prefer space-separated; C/C++ source needs the `\x` form; JavaScript / Python array initialisers want the `0x, 0x` form.

Related tools