Text ↔ Hex Converter
Convert text to hexadecimal and hex back to text right in your browser. Full UTF-8 support means every character encodes correctly — choose lowercase or uppercase, and space-separated or continuous bytes.
Case
Separator
Enter data above to see the converted result here.
How to use Text to Hex Converter
- 1
Choose a direction
Use the toggle to pick Text to Hex or Hex to Text. The swap button moves your result into the input so you can convert it back the other way.
- 2
Enter your data
Type or paste text, or paste a string of hex. The conversion runs automatically as you type, with full UTF-8 support for any character.
- 3
Pick the format
For hex output, choose lowercase or uppercase digits and a space between each byte or a continuous stream. When decoding, spaces, commas, and colons are all optional.
- 4
Copy the result
Review the converted output and copy it to your clipboard, ready to paste wherever you need it.
Text to Hexadecimal: A Complete Guide
What hexadecimal is
Hexadecimal, usually shortened to hex, is the base-16 number system. Where decimal uses ten digit symbols and binary uses two, hex uses sixteen: the digits 0 through 9 for the values zero to nine, and then the letters A through F for the values ten to fifteen. So A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15. Case does not change the value, so 0xff and 0xFF are the same number.
Hex is the programmer's shorthand for binary. Each hex digit corresponds to exactly four bits, because four bits hold sixteen possible values, so two hex digits describe one eight-bit byte perfectly. That clean fit is why bytes are almost always written in hex rather than as long strings of ones and zeros — it is far more compact and far easier to read.
Two hex digits per byte
A byte is eight bits and can hold any value from 0 to 255. In hex that range is written as exactly two digits, from 00 to FF, where FF equals 255. The left digit represents the high four bits, weighted by sixteen, and the right digit represents the low four bits, weighted by one. To find a byte's value you compute the left digit times 16 plus the right digit.
This tool always writes each byte as a two-digit hex pair, padding with a leading zero when needed, so the byte with value 5 appears as 05 rather than just 5. Keeping a fixed two-digit width means the bytes line up and a hex dump can be read unambiguously. You can display the digits in lowercase or uppercase and separate the bytes with spaces or run them together.
From character to hex, step by step
Converting a character to hex is two steps: get its byte value, then write that value in base 16. For ASCII characters the byte value is the familiar code point. Capital A is 65 in decimal. To convert 65 to hex, divide by 16: 65 is 4 times 16 (which is 64) with a remainder of 1, so the high digit is 4 and the low digit is 1, giving 0x41.
That is why A = 0x41 is one of the most recognized values in computing. The same method gives lowercase a, code 97, as 0x61 (6 times 16 is 96, remainder 1), and the space character, code 32, as 0x20 (2 times 16 is 32, remainder 0). Going backward, multiply the first hex digit by 16 and add the second to recover the decimal code, then look up the character.
Worked example: encoding "Hex"
Run the three letters H, e, x through the conversion. H is code 72; dividing by 16 gives 4 remainder 8, so it is 0x48. The letter e is code 101; that is 6 times 16 (96) remainder 5, so 0x65. The letter x is code 120; that is 7 times 16 (112) remainder 8, so 0x78.
Written as a space-separated, uppercase dump, the word "Hex" becomes 48 65 78. In lowercase with no separator it is 486578. Decoding reverses the arithmetic: 48 is 4 times 16 plus 8, which is 72, which is H; 65 is 101, which is e; 78 is 120, which is x — recovering the original word.
ASCII versus UTF-8 and multibyte characters
The one-character-two-digits rule applies cleanly only to the original ASCII set, code points 0 through 127. For everything beyond that — accented letters, non-Latin scripts, symbols, and emoji — this tool uses UTF-8, which is variable-width. An ASCII character is one byte, hence one hex pair, but other characters take two, three, or four bytes, hence two, three, or four hex pairs.
The accented é, for example, is the two UTF-8 bytes 0xC3 and 0xA9, so it converts to the hex C3 A9 rather than a single pair. A common emoji is four bytes and becomes four hex pairs. This is why non-English text produces more hex than its visible character count, and it is worth remembering when you are counting bytes rather than letters.
Flexible decoding
The Hex to Text direction reads the input two digits at a time and is deliberately forgiving about formatting. Spaces, commas, and colons between bytes are all ignored, so a plain run like 486578, a spaced dump like 48 65 78, and a colon-separated dump like 48:65:78 all decode to the same word. Both lowercase and uppercase digits are accepted in any mix.
Two rules still must hold: the input may contain only valid hex characters (0-9 and A-F, plus the ignored separators), and the number of hex digits must be even, because every byte needs exactly two. A conversion error almost always means a stray non-hex character slipped in or the digit count came out odd — perhaps one digit is missing from a byte. Fix that and the decode completes.
Where hex is used
Hexadecimal is everywhere in programming and debugging. Memory addresses, byte offsets, and raw data dumps are shown in hex because two digits map so neatly to a byte. When you inspect a file or network packet in a hex editor, you are reading exactly the kind of output this tool produces. Hex also encodes binary identifiers compactly, such as hashes and UUIDs.
You have likely seen hex outside of byte dumps too. CSS and design tools write colors as hex triples like #FF8800, where each pair is the red, green, and blue intensity from 00 to FF. Character escapes in many languages use hex, as in the \x41 that means the letter A. Converting text to hex is a quick way to inspect the precise byte values behind a string, verify an encoding, or prepare data for a context that expects hexadecimal.
Frequently asked questions
How is text converted to hexadecimal?
Does this support emoji and non-English text?
What hex formats does the decoder accept?
Why did I get a conversion error?
Is my data uploaded to a server?
Related tools
Keep going with these handy tools