How to Convert Text to Hex
Converting text to hex turns every character into two hexadecimal digits — the compact shorthand programmers use to read raw bytes. A browser converter does it in one click, handles any language through UTF-8, and converts hex back to text just as easily.
What hexadecimal is
Base 16: 0–9 then A–F
Hexadecimal, or hex, is base 16: it counts with sixteen digits, 0 to 9 followed by A to F, where A means 10 and F means 15. It exists because it is the perfect shorthand for binary. One hex digit holds exactly four bits, so one byte — eight bits — is exactly two hex digits. The letter A, binary 01000001, is hex 41. The letter H is hex 48. Two characters instead of eight.
Why hex is everywhere in computing
That compactness is why hex is everywhere in computing. Colours on the web are hex — #FF5733 is a red-orange. Memory addresses, file signatures, cryptographic hashes and network data are all shown in hex, because it is short enough for a human to read and exact enough for a machine to trust.
How text becomes hex
Two steps: number first, then hex
The conversion has two steps. First, each character is turned into its number in the UTF-8 encoding: A is 65, a is 97, a space is 32. Then each number is written in hexadecimal, padded to two digits, so 65 becomes 41 and 97 becomes 61. Characters outside English take two to four bytes in UTF-8, so an accented letter becomes two hex pairs and an emoji becomes four.
Decoding: pairs back to bytes
Decoding reverses the process: the hex digits are read in pairs, each pair becomes a byte, and the bytes are read back as UTF-8 text. If the hex has an odd number of digits, or the bytes do not form valid UTF-8, the converter says so plainly instead of guessing — a wrong guess would silently corrupt the text.
Convert text to hex in four steps
- Type your text. Write the word or sentence you want to convert. Start with something short, like Hello, so you can see the pattern clearly.
- Open the converter. Go to the Text to Hex Converter. It runs entirely in your browser, so nothing you type is uploaded anywhere.
- Click Text to Hex. Each character becomes one or more pairs of hex digits. Leave Spaces between bytes on to read the output, or turn it off for one continuous string.
- Copy the result. Click Copy output to share the hex — or paste hex back in and click Hex to Text to decode it.
Decoding hex back to text
Hex decodes by the same rule in reverse: the digits are read in pairs, each pair becomes a byte, and the bytes are read as UTF-8 text. The decoder ignores spaces, line breaks and 0x prefixes, so hex copied from a debugger, a tutorial or a colour picker all works the same way.
The one rule is that the digit count must be even — one pair per byte. An odd count means a digit is missing or mistyped, and the converter reports that instead of guessing. The bytes must also form valid UTF-8, which any hex produced from real text will.
Where you will meet hex
Hex turns up whenever raw data needs to be shown to a human. Web developers see it in colour codes. Security work is full of it: password hashes, checksums and digital signatures are all printed in hex. File analysis starts with a hex dump, where the first bytes of a file identify its format — a PNG image always starts with 89 50 4E 47, which spells PNG in ASCII.
For most people, converting text to hex is a learning exercise or a puzzle step: seeing Hello become 48 65 6C 6F makes the idea of encoding concrete in a way that reading about it does not. It is the same text, wearing a different costume — and once you have seen the pattern, hex stops looking like gibberish.
Related guides
- How to Convert Text to Binary (Free, UTF-8) — turn text into its 8-bit binary codes.
- How to Encode Text with ROT13 (Free ROT13 Cipher) — encode text with the ROT13 cipher.
- How to Reverse Text (Free, Characters, Words or Lines) — flip text by characters, words or lines.
Questions people ask
Why does one letter sometimes become more than two hex digits?
Because this converter uses UTF-8. English letters take one byte, or two hex digits, but accented letters take two bytes, most other scripts take three, and emoji take four.
Do the spaces between hex pairs matter?
No. They are only for readability. The decoder ignores spaces, line breaks and 0x prefixes, so you can paste hex in any common format.
Why does my hex say it is invalid?
Hex must have an even number of digits, one pair per byte, and the bytes must be valid UTF-8. Check for an odd digit count or a character outside 0 to 9 and A to F.
What is the difference between hex and binary?
Both represent the same bytes. Binary writes each byte as 8 digits of 0 and 1; hex writes each byte as 2 characters. Hex is four times shorter and much easier to read.