How to use the Text to Binary
- 1
Choose Encode to turn text into numbers, or Decode to turn numbers back into text, then type or paste into the left pane.
- 2
Pick the representation (binary, octal, decimal, hexadecimal or Unicode code points) and the text encoding, which is UTF-8 unless you need UTF-16, Latin-1 or ASCII.
- 3
When encoding, set the separator, group several bytes per value, pad every byte to full width, and add 0b or 0x prefixes if your target expects them.
- 4
When decoding, paste values with spaces, commas, new lines or no separators at all. Prefixes such as 0b, 0x and \x are accepted, and any invalid value is named with its position.
- 5
Switch the output to Byte table to see each character with its code point and UTF-8 bytes, or press the swap button to reverse the direction.
Features
- Converts text to binary, octal, decimal, hexadecimal or Unicode code points and back
- UTF-8, UTF-16 big and little endian, Latin-1 and 7-bit ASCII encodings
- Separator, byte grouping, padding, 0b and 0x prefixes and uppercase hex options
- Forgiving decoder that accepts any separators, prefixes and continuous digit runs
- Pinpoints invalid digits, oversized values and broken UTF-8 sequences with their position
- Byte table showing every character's code point and UTF-8 bytes in hex and binary
- Recognises a pasted binary or hex listing and switches to Decode automatically
- Runs entirely in your browser; nothing is uploaded
Text is stored as numbers
Computers store text as bytes, and bytes are just numbers from 0 to 255. Seeing those numbers is useful when you debug an encoding problem, read a protocol dump, write a test fixture, or explain how text works. This converter shows the numbers in whichever base you need: binary for teaching and bit-level work, hexadecimal for debugging and protocols, octal for old escape sequences, decimal for byte arrays in code.
Encodings matter
The same text produces different bytes in different encodings. In UTF-8, the word café is five bytes, because é needs two. In Latin-1 it is four. In UTF-16 every character takes at least two bytes. Picking the wrong encoding when decoding is the usual cause of mojibake, the garbled characters you see when a file is read with the wrong settings. Switch the encoding here to see the difference immediately, and use the byte table to inspect a single character.
Related tasks
To represent binary data as compact text for transport, use the Base64 Encoder. To fingerprint text or check a download, the Hash Generator computes MD5, SHA-256 and more.
Frequently asked questions
How is text converted to binary?
Why does one character produce several bytes?
What is the difference between bytes and code points?
When should I use UTF-16, Latin-1 or ASCII?
Why does decoding say the bytes are not valid UTF-8?
Is my text uploaded anywhere?
Last updated .