Tooleux

Text to Binary Converter

Convert text to binary and binary back to text. UTF-8, ASCII, and UTF-16 supported.

Runs in your browser. Nothing leaves your device.
Convert text to binary and binary to text. UTF-8, ASCII, and UTF-16. Free, offline, runs in your browser. Read more Show less

What is binary encoding?

Every file on your computer - text, images, videos, programs - is stored as a sequence of bits, each of which is either 0 or 1. When you convert text to binary, you are seeing the actual bytes that a computer would store, written out as groups of eight 0s and 1s.

This is useful for teaching, debugging character encoding problems, competitive programming and CTF challenges, and generally understanding how computers represent text.

How to use

Choose the mode (Text -> Binary or Binary -> Text) and type your input. Output updates live.

For text encoding, the tool treats your input as UTF-8 by default. If you paste ASCII it uses 8 bits per character. Unicode characters (emoji, Cyrillic, Chinese) take 2-4 bytes in UTF-8, so their binary is longer.

For decoding, the tool auto-detects the common layouts: space-separated bytes, dashed bytes, a continuous string of 0s and 1s, and 0b-prefixed bytes.

A quick example

The word Hi in UTF-8:

H = 01001000 (decimal 72, hex 0x48)

i = 01101001 (decimal 105, hex 0x69)

So Hi = 01001000 01101001.

The capital letter A is 01000001. The lowercase a is 01100001. They differ by exactly one bit - the 6th bit position - which is how ASCII organizes uppercase and lowercase.

The ASCII table (decimal 32-126)

ASCII defines 128 characters. The printable range 32-126 is what most people mean when they say "ASCII text".

CharacterDecimalHexBinary
Space320x2000100000
0-948-570x30-0x3900110000-00111001
A-Z65-900x41-0x5A01000001-01011010
a-z97-1220x61-0x7A01100001-01111010

That is why uppercase A is 01000001 and lowercase a is 01100001 - bit 5 flips between cases. It also explains why subtracting 32 from a lowercase letter gives you the uppercase one.

Why 8 bits per byte?

A byte is 8 bits because 8 bits gives you 256 distinct values, which is enough for the printable ASCII range plus control codes plus a margin. Almost every modern computer architecture uses 8-bit bytes; that was not always true (some early systems used 6, 7, or 9), but it has been the standard since the 1970s.

FAQ

Why is my emoji 32 bits long in binary?

Emoji and most non-Latin scripts are outside the range that 1 byte can represent. UTF-8 encodes them across 4 bytes, so a single emoji takes 32 binary digits. This is the correct, standard behavior - it is how the same text would look on disk, in a network packet, or in memory.

What is the difference between ASCII and UTF-8?

ASCII is a 7-bit encoding for 128 characters (English letters, digits, punctuation, and control codes). UTF-8 is a variable-width encoding that starts with the same 128 characters as ASCII but extends to cover every character in every language plus emoji. For plain English text, ASCII and UTF-8 produce identical bytes. For anything else, they diverge.

How do I decode binary that has no spaces?

This tool detects a continuous stream of 0s and 1s and splits it into 8-bit chunks. As long as the length is a multiple of 8, decoding works. If you know the bytes came from a source using 16-bit characters, choose UTF-16 in the options.

Can I convert binary to hex or base64?

Yes, indirectly. Decode the binary to text here, then paste the text into the Hex Encode or Base64 Encode tools. Or work directly with bytes using a scripting language - see the CLI section below.

Why does the output sometimes contain a byte that looks wrong?

If you paste binary whose length is not a multiple of 8, the leftover bits cannot form a complete byte. The tool trims them and appends a warning. In real data this never happens - the source is always a whole number of bytes.

Is this the same as binary code used in computers?

Yes. The 0s and 1s you see here are exactly what the computer stores, just displayed in a human-readable form. The CPU does not "see" 0s and 1s at the assembly level, but every byte, word, and instruction eventually breaks down to bits.

What about signed vs unsigned bytes?

Binary representation is the same; the interpretation differs. 11111111 is 255 as an unsigned byte and -1 as a signed byte. This tool only deals with the raw bit pattern, so signedness does not matter for text conversion.

Command line equivalent
# Python
python3 -c 'print(" ".join(format(b, "08b") for b in "Hi".encode()))'
python3 -c 'print(bytes(int(x, 2) for x in "01001000 01101001".split()).decode())'

# Node
node -e 'console.log([..."Hi"].map(c => c.charCodeAt(0).toString(2).padStart(8,"0")).join(" "))'
node -e 'console.log(Buffer.from("01001000 01101001".split(" ").map(b => parseInt(b, 2))).toString())'

# xxd (any Unix)
echo -n "Hi" | xxd -b
# 00000000: 01001000 01101001

# bc (arbitrary-precision calculator)
echo "obase=2; 72" | bc   # 1001000
echo "obase=2; 105" | bc  # 1101001
Loads a test value into the form
Text
Binary