Free text to hex converter
Text to hex, two digits to a byte
Type words and this converter writes them as hexadecimal — Hex becomes 48 65 78 — and paste hex in the other direction to read the words back. It is free with no account required, and four menus decide the shape of what comes out: UTF-8 or UTF-16, lowercase or capital digits, a 0x or backslash-x in front of each byte, and a line break every 4, 8 or 16 bytes. A table underneath gives every character its own row, with the code point and the bytes it produced.
- 100% free
- No signup
- Reads hex back too
- UTF-8 and UTF-16
- Byte-by-byte table
How to convert text to hex, and hex back to text
Three steps: the encoding menu in the middle is the one that decides whether your bytes match somebody else's.
Type in the top box, or paste hex into it
The page opens on Text → hex, because that is what most visitors are here for; the second button turns the arrow around and the same box then takes hexadecimal instead. Decoding is forgiving about shape — 48 65 78, 0x48 0x65 0x78, 48:65:78 and one unbroken 486578 are all read identically, and upper or lower case makes no difference. The tally at the top of the card keeps count of characters in and bytes out as you type.
Set the encoding, then shape the output
The encoding menu decides how many bytes each character costs: UTF-8 spends one on plain English and up to four on an emoji, while UTF-16 spends two on almost everything and asks you which byte comes first. The three menus beside it are cosmetic and matter more than they sound — a prefix of 0x or backslash-x, a space, comma, colon or nothing between bytes, and a line break every 4, 8 or 16 bytes. Those four settings are why the same word looks different on every hex tool you have used.
Copy it, or send it back through to prove it survived
Copy the hex takes the output exactly as formatted. The button next to it moves the result into the top box and flips the direction, so hex you have just produced is decoded straight back — if the words that return are the words you started with, the encoding was right. The per-character table at the bottom is the place to check one awkward character on its own, with its code point, its bytes in hex and the same bytes in decimal.
Technical specifications
| Directions | Text → hex and hex → text share one input; a single button lifts a finished result back into it and turns the arrow around |
|---|---|
| Encodings | UTF-8 (1 to 4 bytes a character), UTF-16 big-endian and UTF-16 little-endian (2 bytes for the basic plane, 4 for emoji) |
| Byte prefixes | None, 0x on every byte, or the backslash-x escape a C, Python or JavaScript string literal uses |
| Separators and line length | A space, a comma, a colon or nothing between bytes; one continuous line, or a break every 4, 8 or 16 bytes |
| Accepted when decoding | Upper or lower case digits, with the usual clutter stripped first: 0x, backslash-x, U+, #, whitespace, commas, colons, semicolons, full stops, dashes, underscores, slashes and pipes — or one unbroken run |
| Errors it names | A stray digit by its position in the run, an odd digit count, an odd byte count under UTF-16, and invalid UTF-8 with the lead-byte rule it broke |
| Byte order marks | EF BB BF and FE FF are pointed out rather than silently swallowed, and FF FE suggests switching to the other UTF-16 setting |
| Table and limits | One row per character for the first 250 characters; no cap on the boxes themselves, and 100,000 characters convert in roughly 20 ms in this tab |
Frequently asked questions
Why does another tool give different hex for the same words?
Four settings differ between tools and this page hands you all four. Capitals or lowercase for the digits a to f, a 0x or backslash-x in front of each byte or nothing at all, the character sitting between bytes, and above all the encoding — UTF-8 and UTF-16 produce genuinely different bytes for the same sentence, not just a different layout. Hello is 48 65 6c 6c 6f in UTF-8 and 00 48 00 65 00 6c 00 6c 00 6f in UTF-16 big-endian. Match a tool you have to copy by setting the encoding first and the cosmetics second.
How many hex digits does one character take?
Two per byte, and the number of bytes depends on the character and the encoding. In UTF-8 every character of unaccented English is one byte and therefore two hex digits, an accented letter such as é is two bytes and four digits, a Chinese, Japanese or Korean character is normally three bytes and six digits, and every emoji is four bytes and eight digits. UTF-16 works the other way around: two bytes and four digits for almost everything, four for emoji. That is the whole reason a 10-character sentence can produce 40 hex digits without anything being wrong.
What does the 0x in front of a hex number mean?
It is a label saying the digits that follow are base 16, and it is not part of the value — 0x48 and 48 are the same byte. The notation came from the C language in the early 1970s and spread from there into most programming languages, which is why hex copied out of source code so often arrives wearing it. Other traditions mark the same thing differently: assemblers write 48h, HTML colours use a leading #, and URLs use a per-byte %. The decoder here strips 0x, backslash-x, U+ and # before it looks at anything, so pasted code needs no cleaning up first.
My hex has an odd number of digits — what happened?
A digit went missing, because a byte is always exactly two hex digits and an odd count cannot be split. Two causes account for nearly all of it: a leading zero dropped by hand or by a spreadsheet, so 0f was written as f, or a character lost when the string was copied across a line break. The converter names the total it counted so you can work out where the gap is. If the digit count is even and it still fails, the problem is a stray character rather than a missing one, and that is reported by position.
Is this the same as converting hex to decimal?
No — this page converts characters, and hex to decimal is arithmetic on a plain number. The distinction matters because one string answers both questions differently: the byte 41 spells the letter A when read against a character table, and counts as 65 when added up as base 16. If what you are holding is a quantity rather than a message — a colour value, a memory address, a byte count — the number panel on the binary translator does that conversion at any length. Everything on this page treats the digits as text.
What is the difference between UTF-16 big-endian and little-endian?
Only the order of the two bytes inside each character, but get it wrong and the text comes back as unreadable Chinese characters rather than as a warning. Big-endian writes the high byte first, so the letter A is 00 41; little-endian writes the low byte first, giving 41 00. Neither is more correct — it is a hardware convention, and Intel and AMD processors are little-endian while network protocols traditionally are not. A file often announces its choice with two bytes at the very start, FE FF or FF FE, called a byte order mark, and this page tells you when it spots one instead of quietly decoding it as a character.
Can I turn a hex colour code like #ff6600 back into text?
You can, but the result is meaningless, and it is worth knowing why. A colour code is three numbers side by side — ff is 255 units of red, 66 is 102 of green, 00 is none of blue — and they were never characters to begin with. Decoding them as UTF-8 produces a broken-byte error, because ff cannot start a valid UTF-8 character. The bytes only mean something as text when they were written as text in the first place.
Why programmers count in sixteens
Hexadecimal exists because sixteen and eight fit together perfectly. A byte holds eight bits and can therefore be any of 256 values, and 256 is exactly 16 × 16 — so one byte is always two hex digits, never one and a half. Split the byte down the middle and each half, four bits, is one digit from 0 to f: that half-byte is called a nibble, a piece of programmer humour that made it into the standards. Written in binary the same byte takes eight characters and is unreadable at a glance; in decimal it takes one, two or three characters and the width keeps changing; in hex it is always two, always aligned, and converts back to bits in your head. The name is a Greek and Latin hybrid that IBM settled on in the early 1960s while documenting System/360, replacing the earlier and more consistent sexadecimal. Before the byte won, machines with 12-, 24- and 36-bit words made octal the natural choice, because three bits make one octal digit — which is why old Unix file permissions are still written 755.
What the digits actually contain is a decision, not a fact. A character has a Unicode code point — a number, written U+0041 for A — and an encoding turns that number into bytes. UTF-8 spends as few as it can: one byte for the original ASCII range, two for accented Latin and Greek, three for Chinese, Japanese and Korean, four for emoji. UTF-16 spends two for nearly everything, which makes it wasteful for English and compact for Japanese, and forces a second question that UTF-8 never has to ask — which of the two bytes goes first. That is endianness, and it is the reason a file may open with FE FF or FF FE, a byte order mark whose only job is to announce the answer. Nothing about the hex digits themselves records any of this, so the same sentence has several equally correct hex forms. The binary translator takes the same bytes and writes them as 0s and 1s instead, and has a separate panel for treating a number as a number.
Most people meet hex long before they meet a byte. A web colour like #ff6600 is three bytes in a row — 255 red, 102 green, 0 blue. A MAC address is six bytes separated by colons. A file hash is 32 or 64 hex digits. A URL with %20 in it is percent-encoding, one byte per escape, and a backslash-x escape in source code is the same idea with different punctuation. None of those is text, which is the distinction worth carrying away: hex is a way of writing bytes, and bytes only spell words when somebody wrote words into them. When they did, this page reads them back; when they did not, the decoder will tell you the bytes are not valid UTF-8 rather than invent something. To see the same characters spread out one bit at a time, text to binary lays out all eight digits, and for a message meant to be read aloud rather than parsed, the Morse code translator is the other end of the same shelf.
The bytes are made on your side
Whatever you paste stays on your side of the connection. Both directions are computed here in the browser, so an API token, a licence key or the fragment of a file you are picking apart is not transmitted, not stored and not visible to anybody but you. Empty the boxes or leave the page and nothing is retained: no history, nothing to clear, and no account holding on to what you converted last week.