Text to hex and hex to text
Turn any text into its hexadecimal byte codes, or paste hex to read it back as words. Everything runs on your device.
Type or paste text and press Text → Hex to see the hexadecimal code for every byte, or paste hex and press Hex → text to turn those codes back into readable characters. The tool encodes your text as UTF-8 first — the same encoding the modern web uses — so plain English, accented letters, symbols and emoji all convert correctly. Each byte becomes exactly two hex digits, and the whole job happens in your browser with nothing sent anywhere.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste your text in the box and press Text → Hex to get the space-separated byte codes.
- To decode, paste hex (with or without spaces) and press Hex → text to read it back.
- Copy the result, or press Download .txt to save it. Nothing is uploaded.
What this tool does
This is a two-way converter between ordinary text and its hexadecimal byte representation. Text → Hex takes each character, works out the bytes that represent it in UTF-8, and prints those bytes as pairs of hex digits. Hex → text does the reverse: give it a string of hex and it rebuilds the original bytes and decodes them back into characters.
The important idea is that computers do not store letters, they store numbers. The letter H is really the number 72, and hexadecimal is just a compact, human-friendly way of writing that number. Instead of the decimal 72 or the eight-bit binary 01001000, hex writes it as 48 — two neat digits that map directly onto one byte.
How hex encoding works
Hexadecimal is base 16. Everyday numbers are base 10 and use ten digits, 0 through 9. Hex adds six more symbols so it has sixteen digits in total: 0 1 2 3 4 5 6 7 8 9 A B C D E F, where A stands for 10, B for 11, and so on up to F for 15. Because 16 is 2 to the power of 4, a single hex digit represents exactly four bits, and two hex digits represent eight bits — one byte.
To convert a byte, you split its value into two groups of four bits. A byte can hold any value from 0 to 255, which in hex runs from 00 to FF. The left digit is the value divided by 16 and the right digit is the remainder. So the byte 72 becomes 4 and 8, giving 48. Hex is case-insensitive for reading, so 4a and 4A mean the same byte; this tool accepts either and outputs lowercase.
Examples
Start with the two letters Hi. H is byte 72, which is 48 in hex, and i is byte 105, which is 69. So Hi becomes 48 69. The word Hello becomes 48 65 6c 6c 6f — notice the two identical 6c pairs for the double L.
Non-ASCII characters take more than one byte. The accented é encodes to two bytes, c3 a9. The euro sign € takes three bytes, e2 82 ac, and most emoji take four — the grinning face is f0 9f 98 80. This is exactly why UTF-8 matters: a character is not always one byte, so the number of hex pairs can be larger than the number of letters you typed.
When you need it
- Debugging text encoding. When accented letters or emoji show up as garbled "mojibake", dumping the bytes to hex reveals whether the data is really UTF-8, Latin-1 or something else.
- Colours in design and CSS. Web colours are hex —
#FF0000is red — because each pair is one byte of the red, green and blue channels. - Hex dumps and file inspection. Tools that show the raw contents of a file print every byte in hex so you can spot headers and magic numbers.
- Assembly and low-level programming. Machine code, memory addresses and register values are almost always written in hex.
- Network protocols. Packet captures, checksums, MAC addresses and protocol fields are read in hex.
Doing it without this tool
On a Mac or Linux machine the classic command is xxd: piping text through echo -n "Hi" | xxd -p prints 4869, and xxd -r -p reverses it. In Python you can write "Hi".encode().hex() to get 4869, and bytes.fromhex("4869").decode() to get the text back — the .encode() step is UTF-8 by default, matching this tool exactly.
By hand it is slower but instructive: look up each character in an ASCII or Unicode table to get its byte value, then divide by 16 to get the two hex digits. That works fine for a few ASCII letters, but multi-byte characters require you to apply the UTF-8 encoding rules, which is where a tool saves real effort.
Privacy: your text never leaves your browser
Every conversion here runs in JavaScript on your own device. The text you paste, the hex you decode and the result you copy are never sent to a server, never logged and never stored. Open your browser network panel while you convert and you will see no requests leave your machine. You can even save this page and use it fully offline, which makes it safe for keys, tokens or anything else you would not want to send to a website.
Related tools
Frequently asked questions
ASCII is a table that maps characters to numbers — the letter A is 65. Hexadecimal is just a way of writing numbers in base 16. So "hex" is the notation and "ASCII" (or Unicode, more precisely) is the character-to-number mapping. This tool combines both.
Because it takes more than one byte in UTF-8. Plain ASCII characters are a single byte, so two hex digits, but accented letters use two bytes, many symbols use three, and emoji use four. Each byte is still exactly two hex digits.
For decoding, this tool is forgiving: it accepts hex with spaces, without spaces, or with a leading 0x, and ignores those separators. What must stay correct is the order and the pairing — two digits per byte.
The tool outputs lowercase hex by default, which is the common convention in programming and hex dumps. When decoding it accepts both cases, since 4A and 4a represent the same byte.
UTF-8, the dominant encoding on the modern web. That is why é becomes c3 a9 rather than a single byte. If you paste hex produced with a different encoding, such as Latin-1 or UTF-16, the decoded text may look wrong.
You can encode and decode any UTF-8 text, so it is ideal for strings and messages. Hex colours like FF0000 are already raw byte values, and binary file bytes are best viewed with a dedicated hex editor.
No. The conversion runs entirely in your browser with JavaScript, so nothing you type is sent to a server or stored. You can disconnect from the internet, or save the page, and it will keep working.