Binary Translator

Convert text to binary code and binary back to text.

Text to binary and back

This converts text into its binary representation and back again. Each character is mapped to a number by a character encoding, and that number is written in base 2. For ordinary English text using ASCII, each character becomes eight bits.

A = 65 = 01000001
a = 97 = 01100001
0 = 48 = 00110000
space = 32 = 00100000

A worked example

The word Hi:

To convert a byte back, add up the place values where a bit is 1. Reading 01001000 from the left: 128 x 0, 64 x 1, 32 x 0, 16 x 0, 8 x 1, 4 x 0, 2 x 0, 1 x 0 = 72.

Place values

Bit position87654321
Value1286432168421

An 8-bit byte represents 0 to 255, which is 256 distinct values. Useful anchors for reading ASCII: uppercase letters run 65-90, lowercase 97-122, and digits 48-57. Uppercase and lowercase differ by exactly 32, which is a single bit — the sixth. Flipping that one bit changes case, which is why case conversion is so cheap in low-level code.

Beyond ASCII: UTF-8

ASCII covers only 128 characters, which is not remotely enough for the world's writing systems. UTF-8 extends it using a variable number of bytes per character while keeping the first 128 identical to ASCII, so plain English text is byte-for-byte the same in both.

Character rangeBytesExample
ASCII (U+0000-U+007F)1A, z, 7
Latin accented, Greek, Cyrillic2e-acute, alpha
CJK, most other scripts3Chinese, Japanese, Korean
Emoji, rare scripts4Emoji characters

The leading bits of the first byte announce how many bytes follow, which is what makes UTF-8 self-synchronising: a decoder that starts mid-stream can find the next character boundary. This is why a single emoji can produce 32 bits of binary while a letter produces 8, and why "number of characters" and "number of bytes" are different questions.

Why binary at all

Digital circuits distinguish two states reliably — voltage present or absent, charge stored or not — and two states are far easier to keep unambiguous than ten would be. Everything above that is a convention built on top: numbers, text, images and instructions are all sequences of bits given meaning by whatever is reading them. The same 01001000 is the letter H, the number 72, or a machine instruction, depending entirely on context.

Related bases

Binary is verbose, so programmers usually write the same values in hexadecimal, where each digit represents exactly four bits.

DecimalBinaryHex
10000010100A
720100100048
25511111111FF

Grouping bits in fours and converting each group is far quicker than working in binary directly, which is why colour codes, memory addresses and byte dumps are all written in hex.

Frequently asked questions

How many bits is one character?

Eight for any ASCII character. In UTF-8, characters outside ASCII take two, three or four bytes — so 16, 24 or 32 bits. An emoji is usually four bytes.

How do I convert binary to text by hand?

Split the string into groups of eight, then for each group add the place values of the positions holding a 1, reading 128, 64, 32, 16, 8, 4, 2, 1 from the left. Look the resulting number up in an ASCII table.

Why do uppercase and lowercase differ by 32?

Because ASCII was laid out so that the two cases differ by a single bit — the one worth 32. Flipping that bit converts between cases, which made case handling extremely cheap on early hardware.

What is the largest number in one byte?

255, since eight bits give 256 values counting from zero. Two bytes reach 65,535 and four bytes reach 4,294,967,295, which is why 32-bit limits appear so often in older software.

Does this handle emoji and non-English text?

Yes. Text is encoded as UTF-8 before conversion, so accented letters, non-Latin scripts and emoji all convert correctly — they simply produce more bytes per character than plain ASCII does.

🔗 Related tools

🔐Base64 Encode/Decode🆔UUID Generator🎨HEX ↔ RGB{ }JSON Formatter🔳QR Code GeneratorRoman Numerals