Tech

Text to binary converter

Type text and we convert it to binary (8 bits per UTF-8 byte), hexadecimal and ASCII decimal. It also works in reverse: paste binary and get the original text back.

Instant🔒In your browserNo signup
Live
Binary (8 bits)
Hexadecimal
Decimal (ASCII / bytes)

How ASCII and UTF-8 work

Computers only understand numbers, so every character you type has a number assigned to it. The oldest and most famous table is ASCII, which gives a code from 0 to 127 to English letters, digits and basic symbols. "A" is 65, "a" is 97, the space is 32. When text contains accents, emoji or characters from other alphabets, UTF-8 comes into play — an encoding that extends ASCII and can represent more than a million distinct characters.

Why 8 bits make a byte

A bit is the smallest unit: it is either 0 or 1. Grouping 8 bits forms a byte, which can take 256 distinct values (2 to the 8th power). That is more than enough for the 128 ASCII characters, which is why historically one character equalled one byte. Each bit inside the byte represents a power of two: 128, 64, 32, 16, 8, 4, 2, 1. Adding up the positions that hold a 1 reconstructs the number. For example, 01000001 is 64 + 1 = 65, which is "A".

Multibyte characters: the magic of UTF-8

UTF-8 is clever because it is backward compatible: the first 128 codes are identical to ASCII and take a single byte. For everything else it uses 2, 3 or 4 bytes as needed. "ñ" is encoded with 2 bytes, the euro sign "€" with 3, and many emoji with 4. That is why, when you convert a phrase with accents, you will see more 8-bit groups than characters. This tool uses TextEncoder, the browser's native API, which produces exactly the same bytes as any real UTF-8 file.

From binary back to text

The reverse process groups the bits into eights, converts each group to its number, and asks TextDecoder to rebuild the characters, joining multibyte sequences where needed. We accept binary with spaces between bytes or run together; the only requirement is that the total number of bits is a multiple of 8 and that there are no characters other than 0 and 1. If something does not add up, we tell you with an error instead of returning broken text.

What converting text to binary is for

  • Understanding how data is really stored in a computer.
  • Programming, networking or systems exercises and homework.
  • Debugging encoding issues (why "ñ" shows up instead of "ñ").
  • Games, puzzles and hidden messages in binary.
  • Teaching the relationship between characters, bytes and bits.

Reference: common characters in binary

CharacterDecimalBinaryHex
A650100000141
a970110000161
0480011000030
(space)320010000020
!330010000121

FAQ

How is a letter converted to binary?

Each character has a number (ASCII/Unicode) written in base 2 and padded to 8 bits. "A" is 65, which is 01000001.

Why are 8 bits used per character?

8 bits make a byte and represent 256 values, enough for ASCII. UTF-8 uses 1 byte for common characters and up to 4 for the rest.

What happens with accents, emoji or non-Latin characters?

UTF-8 encodes them with several bytes ("ñ" uses 2, "€" uses 3). We use TextEncoder, so the conversion is exact.

Can I go from binary back to text?

Yes, paste the 8-bit groups (with or without spaces) and we decode them with TextDecoder, respecting UTF-8.

What happens if the binary is malformed?

If there are characters other than 0 and 1, or the bit count is not a multiple of 8, we show a clear error. It never returns NaN.

What is the difference between ASCII and UTF-8?

ASCII defines 128 characters with 7 bits; UTF-8 extends it and is compatible: the first 128 codes match.

Is my text sent to a server?

No, everything happens in your browser with TextEncoder and TextDecoder. Your text never leaves your device.

Can I copy the results?

Yes, every representation has its own button to copy to the clipboard.

Was this generator useful?