Binary translator

Converts text into binary code and decodes binary back into readable text.

This binary translator converts text to binary code and turns binary back into text. Type a word and press Text → binary to see it as ones and zeros, or paste a string of binary groups and press Binary → text to decode it. Both directions work instantly in the same box.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.

How to use it

  1. Type or paste your text into the box.
  2. Press Text → binary to encode it, or Binary → text to decode.
  3. Read the result in the same box.
  4. Press Copy to take it with you.

What this tool does

Encoding happens in three steps. Each character is looked up to get its numeric code point — A is 65, a is 97, a space is 32. That number is written in base 2, using only the digits 0 and 1. The result is padded with leading zeros to at least eight digits, because eight bits make one byte, and groups are separated by a single space so the output stays readable.

Decoding reverses it: the input is split on whitespace, each group is read as a base-2 number, and that number is turned back into a character. If the input contains anything other than 0, 1 and spaces, it is left untouched rather than producing garbage — so pressing the decode button on ordinary text does no harm.

Line breaks in your text become their own code (10), so multi-line input round-trips correctly. There is no length limit worth worrying about; a page of text produces a long but perfectly valid string.

Examples

TextBinary
A01000001
Hi01001000 01101001
(space)00100000
000110000

Walking through the letter H: its code point is 72. In base 2, 72 is 1001000 — seven digits. Pad to eight and you get 01001000. Every ASCII character behaves the same way, which is why English text always comes out as neat eight-digit groups.

Beyond ASCII. Only the first 128 characters fit in eight bits. A Cyrillic letter such as Д has code point 1044, and 1044 in binary is 10000010100 — eleven digits, so the group is longer than eight. Emoji are further out still: 🙂 is code point 128578, which is 11111011010000010. In a real file those characters are stored as two, three or four bytes using UTF-8. Here each character is shown as one group of however many bits it needs, which keeps the mapping between character and group obvious.

When you need it

Doing it without this tool

Excel: =DEC2BIN(CODE(A1),8) converts one character. CODE gives the code point, DEC2BIN converts it, and the 8 pads it. Note that DEC2BIN only handles values up to 511, so anything outside basic Latin fails.

Python: " ".join(format(ord(c),"08b") for c in "Hi") encodes; "".join(chr(int(b,2)) for b in s.split()) decodes.

Command line: echo -n "Hi" | xxd -b shows the bits of every byte. To go back, echo "01001000 01101001" | perl -lape "$_=pack(qq(B*),join q(),split)".

JavaScript console: "Hi".split("").map(c=>c.charCodeAt(0).toString(2).padStart(8,"0")).join(" ").

By hand: look the character up in an ASCII table, then repeatedly divide the number by two and read the remainders bottom to top. Slow, but it is the exercise the homework is usually asking for.

Bits, bytes and why eight

A bit is a single binary digit: 0 or 1, off or on. One bit gives two possibilities, two bits give four, three bits give eight, and each extra bit doubles the range. Eight bits give 256 combinations, from 00000000 to 11111111.

Eight bits together are called a byte, and that grouping is not an accident. The original ASCII standard defined 128 characters — the English alphabet in both cases, the digits, punctuation and a set of control codes — which needs seven bits. Hardware settled on eight, one spare bit that was later used for a second block of 128 accented and box-drawing characters. Once memory was addressed in bytes, the byte became the unit everything else is measured in.

BitsValuesCovers
7128Original ASCII
8256One byte, extended Latin
1665,536Most living scripts
211,114,112All of Unicode, emoji included

Unicode assigns a number to every character in every script, well past what eight bits can hold. UTF-8 solves that by using one byte for the old ASCII range and two, three or four bytes for everything else — which is why a Cyrillic letter takes twice the storage of a Latin one, and an emoji takes four times.

Privacy: your text never leaves your browser

The conversion is arithmetic performed by JavaScript in your tab. Nothing is sent anywhere, nothing is stored, and the page needs no network access after it loads.

That is worth knowing if you are decoding something you received and do not yet trust, or encoding a message you would rather not have sitting in someone else’s server log.

Related tools

Monospace textEven-width typewriter letters you can paste anywhere plain text goes.Lorem ipsumGenerates 3, 5 or 10 paragraphs of classic placeholder text with one click.SuperscriptType text, get raised ² ⁿ ˣ characters you can paste anywhere plain text goes.Italic textTurn plain text into slanted Unicode letters you can paste anywhere — no…Magic 8 ballAsk a yes or no question. The ball answers.Meta description lengthWhy 160 characters is a rule of thumb and 920 pixels is the real limit.PDF text breaksThe file has no paragraphs to give you. Here is what it does have, and how to…

See all text tools →

Frequently asked questions

How do I convert text to binary?

Paste the text and press Text → binary. Each character becomes its code point written in base 2, padded to eight bits.

What format should binary input be in?

Groups of 0s and 1s separated by spaces, for example 01001000 01101001. Anything containing other characters is left unchanged.

Why are eight bits used per character?

Eight bits make one byte, and the original ASCII set fits inside eight bits, so it became the standard grouping.

Why is Cyrillic or emoji longer than eight bits?

Their code points are larger than 255, so they need more than eight bits. In files they are stored as two to four bytes using UTF-8.

Can I decode binary back into text?

Yes. Paste the binary groups and press Binary → text; each group is read as a base-2 number and turned back into a character.

Does it handle line breaks?

Yes. A line break is character code 10, so it converts and converts back like any other character.

Is my text uploaded anywhere?

No. The conversion runs entirely in your browser and nothing is transmitted or saved.