Text to Hex Converter
Type text to see its UTF-8 bytes as hexadecimal, or paste hex to read the text it spells. Accented letters and emoji round-trip correctly, you choose spaced, continuous or 0x-prefixed output, and a byte count shows the size. Free, no sign-up, and the conversion runs in your browser.
Direction
Hex output grouping
How to Use the Text to Hex Converter
- 1. Choose a direction. Auto-detect decodes only input that clearly is hex, meaning separated two-digit bytes (
48 65 6c) or 0x-prefixed bytes; everything else is encoded. Text → Hex and Hex → Text force a direction, and the result heading says which way it went. - 2. Choose the hex grouping. Spaced (
48 65), continuous (4865) or 0x-prefixed (0x48 0x65). This affects only text-to-hex output. - 3. Type or paste. The result and a byte count appear as you type.
- 4. Copy it. Copy Result copies the output; Clear empties the box.
How Text Becomes Hex
Computers store text as bytes, and a byte is eight bits — exactly two hexadecimal digits, since each hex digit stands for four bits. The tool first encodes your text as UTF-8 (RFC 3629), which uses one to four bytes per character, and then writes each byte as two lowercase hex digits. Plain ASCII characters take one byte and keep their familiar values, so A is 41. Everything else takes more:
| Character | Code point | UTF-8 bytes (hex) | Bytes |
|---|---|---|---|
| A | U+0041 | 41 | 1 |
| é | U+00E9 | c3 a9 | 2 |
| ☕ | U+2615 | e2 98 95 | 3 |
| 😀 | U+1F600 | f0 9f 98 80 | 4 |
This is why hex output can be longer than the text, and why it differs from decimal character codes: é is the single code point 233 but the two bytes c3 a9.
Worked Example
Input
Hello, World!
Spaced
48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21
Continuous
48656c6c6f2c20576f726c6421
0x-prefixed
0x48 0x65 0x6c 0x6c 0x6f 0x2c 0x20 0x57 0x6f 0x72 0x6c 0x64 0x21
Size
13 bytes
Going back, 63 61 66 c3 a9 decodes to café, and e2 98 95 to ☕. When decoding, spaces, commas, line breaks and 0x prefixes are all ignored, so you can paste hex from a debugger, a packet dump or source code; what is left must be hex digits only, in pairs.
Reading the Errors and Surprises
- "Input contains characters that are not hex digits." Something other than 0–9 and a–f (in either case) is in the input, apart from separators and
0x. - "Hex input has an odd number of digits." Each byte needs two digits, so a missing or extra digit makes the length odd. Check for a dropped leading zero (
5should be05). - Replacement characters (�). Bytes that are not valid UTF-8 — a lone
ff, for example — decode to the replacement character rather than failing. If you expected text, the data is probably in another encoding or is not text at all. - Auto-detect needs separators to recognise hex. A single run such as
cafe,deador2024could be a word or a number as easily as hex, so it is encoded as text. Continuous hex such as48656c6c6fis read as text too: choose Hex → Text for it, or separate the bytes with spaces. - Output is lowercase. Change the case in your editor if your destination needs capitals.
Which Tool Do You Need?
| The same text, "Hi" | Tool |
|---|---|
48 69 — hexadecimal bytes | This page |
01001000 01101001 — 8-bit binary bytes | Binary Code Translator |
72 105 — decimal character codes, plus an ASCII table | ASCII Converter |
SGk= — Base64, URL encoding, HTML entities | Text Encoder & Decoder |
| A number from one base to another, such as 255 to FF | Number Base Converter |
Frequently Asked Questions
- How do I convert text to hex?
- Type or paste the text with the direction set to Text → Hex (or leave it on Auto-detect). Each character is encoded as UTF-8 bytes and every byte is shown as two hexadecimal digits, so Hi becomes 48 69.
- How do I convert hex to text or ASCII?
- Paste the hex, with the direction set to Hex → Text. Spaces, commas, line breaks and 0x prefixes are ignored; the remaining digits must be an even number. The bytes are decoded as UTF-8, which for plain ASCII bytes gives exactly the ASCII text.
- What grouping formats are available?
- Spaced (48 65), continuous (4865) and 0x-prefixed (0x48 0x65). All three decode back identically with Hex → Text selected (Auto-detect recognises the spaced and 0x-prefixed forms, but reads continuous hex as text), so pick whichever your destination expects: spaced for reading, continuous for code strings, prefixed for source code.
- What encoding does the converter use?
- UTF-8. ASCII characters are one byte each; accented letters, symbols and emoji take two to four bytes. Other encodings such as UTF-16 or Latin-1 would produce different bytes for non-ASCII text.
- Why was my hex encoded instead of decoded?
- Auto-detect only decodes separated two-digit bytes or 0x-prefixed bytes, because a bare run like cafe or 2024 could just as well be a word or a number. Continuous hex such as 48656c6c6f is encoded as text; switch the direction to Hex → Text to decode it.
- Why do I see � in the decoded text?
- The bytes you pasted are not valid UTF-8. The tool shows the replacement character for each invalid sequence rather than guessing at another encoding.
- Is my text sent to a server?
- No. The conversion uses your browser's built-in TextEncoder and TextDecoder, and nothing you type leaves your device.