What is a hex encoder?
A hex encoder turns ordinary text into hexadecimal — numbers written in base 16 using the digits 0–9 and the letters a–f — and a hex decoder turns that hex back into readable text. Type “Hello” and you get 48656c6c6f: five characters become ten hex digits. Paste 48656c6c6f in, switch to decode mode, and “Hello” comes back. The default text on this page is “Hello”, so you can see the format before you type anything.
Hexadecimal is the shorthand programmers use when they need to look at raw bytes. Binary is exact but painfully long — eight digits per character — while hex needs only two digits per character, so the same word is four times shorter. That is why hex shows up everywhere in computing: in file headers, in network packets, in colour codes like #FF5733, and in error logs where a byte has to be written down.
This tool covers both directions. Text-to-hex mode converts each character to its two-digit code, with no spaces between the pairs, which is the format most tools and debuggers expect. Hex-to-text mode reads the pairs back into letters. Everything runs in your browser — nothing is uploaded, nothing is stored, and there is no account to create. If you want the longer form, a binary text generator shows the same characters as 0s and 1s.
Hex is not a secret code, even though it looks like one. Anyone can decode 48656c6c6f in seconds, and this page does it for free. Treat hex as a way of writing bytes down, not as a way of hiding them.
How text becomes hex: two digits per character
The method is simple and exact. Every character has a number — its ASCII value between 0 and 127 — and that number is written in base 16 using exactly two digits. The letter H is 72 in decimal, and 72 in hex is 48. The letter e is 101, which is 65 in hex. The letter l is 108, which is 6c, and o is 111, which is 6f. The formula is: hex = the ASCII value of each character, written as a two-digit base-16 number.
Two hex digits make one byte, so the length of the output is easy to predict: a word of 5 characters becomes 10 hex digits, a sentence of 20 characters becomes 40, and a paragraph of 500 characters becomes 1,000. The counter above the output shows the character count, the hex digit count, and the byte count, so you can see the two-to-one ratio for any text you type.
Decoding is the same process in reverse. The tool reads the hex two digits at a time, turns each pair into a number, and looks up the character with that value. The pair 48 is 72, which is H; the pair 69 is 105, which is i. Pairs that are not valid hex digits are skipped, so one bad pair does not corrupt the rest of the message. A ASCII converter shows the same characters as plain decimal numbers if you want to check the values by hand.
Text to hex vs hex to text: which mode to use
Text-to-hex mode is the one most people want. You have words and you need their hex form — for a coding exercise, a debugging session, a hash input, or a puzzle. Type or paste the text, and the hex appears instantly, two digits per character with no spaces. The default “Hello” is the fastest way to see the format: five pairs, starting with 48, because every common letter lives below 128.
Hex-to-text mode is for the opposite job: you have a string of hex digits and you need the words behind it. Paste the hex, switch the mode, and the text appears. This is the mode to use when a log file, a packet capture, or a puzzle hands you hex and asks what it says. It also works as a check on your own encoding — encode a word, copy the hex, decode it, and the original word should come back exactly.
The two modes are exact inverses for normal text. Anything you can type on a keyboard — letters, digits, punctuation, spaces — survives the round trip unchanged. What does not survive is hex that was not made in pairs: an odd number of digits leaves a final single digit with no partner, and that digit is dropped rather than guessed. If your decode comes back one character short, count the digits first — an odd length is the usual cause.
A worked example: “Hello” in hex
Take the default text, “Hello”. It has 5 characters, so the output has 10 hex digits and 5 bytes. Letter by letter: H is 72, which is 48; e is 101, which is 65; l is 108, which is 6c; the second l is the same, 6c; o is 111, which is 6f. Put together with no spaces, the full output is 48656c6c6f.
Try a shorter one. “Hi” has 2 characters, 4 hex digits, and 2 bytes: H is 48 and i is 105, which is 69, so the output is 4869. Now decode it back: paste 4869, switch to hex-to-text mode, and the tool returns “Hi” — 2 characters, 4 hex digits, 2 bytes. The round trip is exact, which is the simplest way to check that an encoding is correct.
A couple of useful reference points: the capital letter A is 65, which is 41 in hex, and a lowercase a is 97, which is 61 — the difference between upper and lower case is always 32, which is 20 in hex. A space is 32, which is 20. The digit 0 is 48, which is 30 in hex, and the digit 9 is 57, which is 39. Once you know A and the space, you can read short hex messages almost by eye.
Spaces in the input are encoded just like letters. “Hi there” is 8 characters, so it becomes 16 hex digits: 48 69 20 74 68 65 72 65 without the spaces, or 4869207468657265 as one string. The space becomes 20, sitting between 69 and 74. If your decoded text is missing its spaces, the hex you pasted probably lost its 20 pairs along the way.
Who uses a hex encoder, and why
Developers are the biggest users. Hex shows up in debugging, in file formats, in network packets, in hashes, and in low-level code, and a quick text-to-hex conversion settles arguments about what a byte actually holds. When a log prints a string of hex and nobody can read it, pasting it here turns it back into words in a second.
Students are the second group. Number bases are taught in school computer science and in first-year university courses, and nearly every course asks students to convert a word to hex by hand. This tool is the answer key: encode the word, check your hand calculation against it, and find the pair where you went wrong. A student who checks five words this way learns the pattern faster than one who converts fifty without checking.
Puzzle makers and CTF players are the third group: hex messages hide in escape rooms, treasure hunts, and hacking competitions, where a string of hex digits is a clue that needs decoding before the next step opens. Designers use hex too, though for a different reason — colour codes like #FF5733 are hex values for red, green, and blue, and knowing that FF means 255 makes a colour picker far less mysterious.
Hex encoder vs other text encoders
Hex is one of several ways to write text as numbers, and each has its place. A binary text generator writes each character as 8 binary digits, so “Hello” becomes 40 digits — exact, but four times longer than hex. Base64 is shorter still and safe to paste into URLs and emails, which is why a base64 encoder decoder is the tool for moving text through systems that dislike raw bytes.
A ASCII converter shows the same characters as decimal numbers, which is the easiest form to do arithmetic on. Morse code is the older cousin: dots and dashes instead of digits, with short codes for common letters. A Morse code generator is the fun one for messages and puzzles.
The practical rule is simple. Use hex when you need to read bytes quickly — in a log, a packet, or a file header. Use binary when you need to see or teach what a computer stores, bit for bit. Use base64 when you need to move text through a system safely. Use Morse when you want a puzzle. All four are the same idea — text written as something else — and knowing which one fits the job is most of the skill.
Common mistakes when working with hex
The most common mistake is an odd number of digits. Every character needs exactly two hex digits, so a valid hex string always has an even length. Paste 48656c6c6 and the final 6 has no partner, so the decoder drops it and the last letter vanishes. Count the digits before you blame the tool — an odd count is the usual cause.
Second: mixing up hex and decimal. The hex pair 65 is 101 in decimal, which is the letter e — but the number 65 on its own is the letter A. When a homework question says “convert 65”, check whether it means the decimal number 65 or the hex digits 65. The answers are different, and this is the single most common wrong answer in hex homework.
Third: forgetting that spaces count. A space is a real character with the hex code 20, and a sentence with five spaces has five 20 pairs in its hex. If your encoded output looks shorter than you expected, you probably typed the words without spaces, or the tool you compared against stripped them.
Fourth: assuming hex is encryption. It is not. Hex is just another way of writing the same text, and anyone can decode it in seconds — this page does it for free. If a message needs to stay secret, hex will not keep it secret; it only makes it longer and harder to read at a glance. Real secrecy needs a cipher or a password, not a change of base.
How to use this hex encoder
Using this hex encoder is simple. Type or paste your text into the box — “Hello” is already there as the default. Leave the mode on text-to-hex, and the hex appears in the output box below, with the character count, hex digit count, and byte count shown above it. Copy the output with the copy button, or select it by hand.
To decode, paste hex into the same box and switch the mode to hex-to-text. The words appear in the output box. If some letters are missing, check that the hex has an even number of digits made only of 0–9 and a–f — that fixes nearly every failed decode. If the text needs tidying first, a case converter can fix the capitalisation before you encode it.
Everything runs in your browser. No sign-up, no account, no data sent anywhere — your text never leaves your device, and the page works offline once it has loaded. Try it with something real before you need it: type your name, read its hex, decode it back, and watch the round trip land exactly. Once you have done it twice, converting text to hex stops feeling like a puzzle and starts feeling like reading.