What it does
Computers store text as bytes. This tool encodes your text as UTF-8 and shows each byte in the base you choose. For example, Hi is 01001000 01101001 in binary and 48 69 in hex.
How to use
- Pick "Text to bytes" and type your text, or pick "Bytes to text" and paste values separated by spaces, commas or new lines.
- Choose binary, hex, octal or decimal.
- When decoding, prefixes such as
0xor\xare accepted.
Good to know
Characters outside basic ASCII use two to four bytes in UTF-8, so a single emoji produces several byte values. Decoding checks that the bytes form valid UTF-8 and tells you if they do not.
Examples
Hiin binary is01001000 01101001and in hex48 69.éis two bytes in UTF-8:C3 A9in hex.- The emoji
😀is four bytes:F0 9F 98 80in hex, or11110000 10011111 10011000 10000000in binary. - In the other direction,
01001000 01100101 01101100 01101100 01101111decodes toHello.
How text becomes binary
Every character has a number, and UTF-8 stores that number in one to four bytes. The letters, digits and punctuation of basic ASCII fit in one byte: the letter H is 72 in decimal, which is 01001000 in binary. A byte is eight bits, so each group in the binary output is eight digits long. Characters outside ASCII need more bytes, which is why one emoji produces several values. For a lookup of the first 128 characters, see the ASCII Table.
Binary, hex, octal and decimal
The bytes are the same in every format; only the number base changes. The letter H is 01001000 in binary, 48 in hex, 110 in octal and 72 in decimal. To convert a single number between bases, use the Number Base Converter.
Common problems
When you decode, the bytes must form valid UTF-8. A value such as FF FE never appears in valid UTF-8, so the tool answers “These bytes are not valid UTF-8 text.” instead of showing garbage. If a result looks wrong, check that you chose the same format for decoding that you used for encoding.
Frequently asked questions
Is binary a kind of encryption?
No. Binary is just another way to write the same bytes, and anyone can convert it back.
What is the difference between ASCII and UTF-8?
ASCII covers 128 characters. UTF-8 stores those the same way, in one byte each, and adds every other character using two to four bytes.
Can I paste binary with spaces or line breaks?
Yes. Values separated by spaces, commas or new lines are accepted, and in hex you can also use prefixes such as 0x.
Is my text uploaded?
No. The conversion runs in your browser.
Privacy
This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.