Computers store text as numbers, and this tool shows you exactly which ones. It converts text to binary, hexadecimal, decimal or octal and back again, working on the real UTF-8 bytes, so accented letters, symbols and emoji come out right. Handy for learning how encoding works, for decoding a string you've been handed, or for making a binary message for a poster.
How to use it
- Choose a direction from the menu, such as "Text to binary" or "Hexadecimal to text".
- Type or paste your input.
- Read the output, which updates as you type.
- Copy it.
When it helps
- Seeing how a word is stored as bytes, for a class or out of curiosity.
- Decoding a binary or hex string from a puzzle.
- Counting how many bytes a piece of text really takes.
- Making binary text for a design.
Good to know
- When going back to text, put spaces between bytes, or paste one long string and it will be split into groups of 8 (binary) or 2 (hex).
- A character outside basic English takes more than one byte, so "é" gives two groups.
- If a group isn't valid, the message names it so you can fix the typo.
What the output actually represents
When you type "A", your computer stores the number 65. Binary writes that as 01000001, hexadecimal as 41, octal as 101 and decimal, of course, as 65. This tool shows those numbers for every byte of your text, separated by spaces so you can see where one character ends and the next begins.
Text is encoded as UTF-8, the standard on the web. Basic English characters take one byte each, accented letters take two, and most emoji take four. So the word "café" is five bytes, even though it looks like four characters.
Worked example: the word Hi
The letter H is 72 in decimal, which is 01001000 in binary, and i is 105, or 01101001. So "Hi" becomes 01001000 01101001. In hexadecimal it's 48 69, and in octal 110 151. Paste the binary back with the Binary to text option and you get "Hi" again.
If you paste binary without spaces, the tool splits it into groups of eight bits for you. A long string whose length isn't a multiple of eight can't be split into whole bytes, and the tool will tell you something is wrong.
A word on secrecy
Binary and hexadecimal are ways of writing numbers, not ways of hiding them. Anyone can convert them back in seconds, so a message in binary is no more private than the same message in plain text. If you need privacy, use real encryption such as the AES Text Encryptor.
Still, converting text to binary is a good way to understand how data is stored. Try a single emoji and watch it grow into four bytes, or compare uppercase and lowercase letters, which differ by just one bit.
Questions
Why does one emoji give four bytes?
UTF-8 uses between one and four bytes per character, and emoji sit at the high end.
Is this a way to hide a message?
No. It's only a change of notation, and anyone can reverse it.