Text to Binary / Hex / ASCII Converter
Inputs
| Text | Hi |
|---|
Text to Binary / Hex / ASCII Converter
Enter any text to see it as binary, hexadecimal, and decimal character codes. Binary and hex follow the UTF-8 byte sequence, while decimal lists each character’s Unicode code point — the familiar ASCII value for plain English text.
Inputs
Text
Results
Enter a value to see results.
Encodings
Text to Binary / Hex / ASCII
Text is stored as numbers. Every character a computer handles — a letter, a digit, a punctuation mark, an emoji — has a numeric code, and that code can be written in binary, in hexadecimal, or in plain decimal. This converter takes a piece of text and shows all three at once, so you can see exactly how the words on screen become the bits on disk. It is handy for debugging encoding problems, building lookup tables, learning how character codes work, or just satisfying curiosity about what a string really is underneath.
From characters to codes
The mapping from characters to numbers is defined by a character set. The oldest in common use is ASCII, which assigns the 128 codes 0 through 127 to the unaccented Latin letters, the digits, common punctuation, and a handful of control codes. The capital letter H is 72, the lowercase i is 105, a space is 32, and the digit 0 is 48. Modern text uses Unicode, which extends the same idea to every script and symbol in use, while keeping the original ASCII codes unchanged.
Once a character has a code, writing it in another base is ordinary arithmetic. The number 72 is 01001000 in binary and 48 in hexadecimal. This converter lists the decimal code of each character, then the binary and hexadecimal of the bytes that encode it.
ASCII versus UTF-8
ASCII covers only 128 characters, each fitting in a single byte. UTF-8 is the encoding that lets Unicode's full range travel through systems that were built for bytes. Its key property is backward compatibility: every ASCII character is encoded as exactly one byte, identical to its ASCII value. Anything outside the ASCII range expands to between two and four bytes.
That is why the binary and hexadecimal output here is grouped by UTF-8 byte. An accented letter such as é (code point 233) is encoded as the two bytes C3 A9; a typical CJK character takes three bytes; an emoji such as 😀 (code point 128512) takes four. The decimal output, by contrast, lists one code point per character, so a multi-byte character still shows as a single decimal number even though it occupies several bytes.
Reading the output
Each space-separated group in the binary and hexadecimal results is one byte: eight bits or two hex digits. Grouping by byte keeps the character boundaries visible, which makes it easy to pick a single character's code out of a long string. The character count and UTF-8 byte count are shown alongside; whenever they differ, the text contains non-ASCII characters that expand to multiple bytes.
Worked example
Take the text Hi. Both characters are in the ASCII range, so each is a single byte.
The decimal codes are 72 105, the hexadecimal is 48 69, and the binary is 01001000 01101001. Two characters, two bytes — character count and byte count match because the text is pure ASCII.
Now take a single emoji, 😀. It is one character but lies far outside ASCII, at code point 128512 (U+1F600). UTF-8 encodes it as the four bytes F0 9F 98 80, so the binary output is four 8-bit groups, the decimal output is the lone code point 128512, and the byte count is 4 while the character count is 1.
Reversing the encoding
The process is lossless and reversible. Split the binary back into 8-bit bytes, or read the hexadecimal two digits at a time, reassemble the UTF-8 byte sequence, and decode it. Because UTF-8 is a fixed standard, any conforming tool reconstructs the original text precisely — no information is lost when going text to binary and back.
Related calculators
To see how a single number is written across decimal, binary, and hexadecimal without the character-encoding step, use the Number Base Converter. To view a 32-bit IPv4 address in its integer, hex, and binary forms, see the IPv4 Address Representation Converter. And to measure how much information a string carries, the Shannon Entropy Calculator estimates its entropy.
Frequently Asked Questions (FAQ)
How is text turned into binary?
Computers store text as numbers. Each character is assigned a code: the letter H is 72, i is 105, a space is 32, and so on. Those numbers are written out in base 2 (binary) using ones and zeros.
For characters in the ASCII range (the basic English letters, digits, and common punctuation), each character is a single byte, so it becomes eight bits. The word Hi is 72 and 105, which in binary is 01001000 and 01101001.
What is the difference between ASCII and UTF-8?
ASCII is the original 7-bit scheme that covers 128 characters: the unaccented Latin letters, digits, punctuation, and control codes. Every ASCII character fits in a single byte.
UTF-8 is a superset that can represent every Unicode character while staying byte-compatible with ASCII. ASCII characters are still one byte, but accented letters typically take two bytes, most other scripts take three, and emoji take four. This converter shows binary and hexadecimal as UTF-8 bytes, which is why a single emoji produces four 8-bit groups rather than one.
Why are the digits grouped with spaces?
Each space-separated group is one byte: eight bits in the binary output, two digits in the hexadecimal output. Grouping by byte makes the boundaries between characters visible and makes it easy to read a single character’s code out of a long string.
The decimal output is grouped by character rather than by byte, so a multi-byte character shows as one decimal code point even though it occupies several bytes.
Can the binary be turned back into text?
Yes. The encoding is reversible: split the binary into 8-bit bytes, convert each byte to its number, reassemble the UTF-8 byte sequence, and decode it back to characters. The same applies to the hexadecimal form. Because UTF-8 is a well-defined standard, any tool that reads UTF-8 will reconstruct exactly the original text.
Recommended Next
IPv4 Address Representation Converter
Enter a dotted-decimal IPv4 address to see it as a 32-bit integer, a hexadecimal value, and dotted binary. Useful for reading packet captures, building access lists, and understanding how addresses are stored.