Skip to the tool
DevToolBench

Text to Binary Converter

Turn text into UTF-8 bits, and bits back into text.

Characters
0
UTF-8 bytes
0
Bits
0
Bytes per character

Everything runs in your browser. Nothing you type is sent to a server.

Found a bug in this tool? Report it.

Share this tool

What this tool does

This text to binary converter turns whatever you type into the bits a computer actually stores, and turns those bits back into readable text. It works in both directions, in three number bases — binary, hexadecimal and octal — and it counts bytes rather than guessing, because the number of groups on the right is almost never the number of characters on the left.

Everything runs in your browser. The text you paste is never uploaded, which matters more than usual here: people convert log fragments, keys and half-remembered strings from other people's systems.

Where 01000001 comes from

Type A and you get 01000001. That is 65 written in base two and padded to eight digits. ASCII, standardised in 1963, laid the alphabet out to make arithmetic cheap: digits start at 48, uppercase at 65, lowercase at 97. The gap of 32 between the cases is one bit, so A | 0x20 is a and a & 0xDF is A — case conversion with no lookup table, on hardware that could not afford one.

The padding to eight is a convention rather than a requirement. ASCII only needs seven bits; the eighth arrived when bytes settled on eight bits and stayed there, first as a parity check and later as the doorway to everything that is not English.

Where one character stops being one byte

That doorway is UTF-8, and it is where most converters quietly lie. UTF-8 is variable length: a code point below 128 takes one byte, most Latin and Greek letters take two, the bulk of the world's scripts take three, and everything above U+FFFF — emoji included — takes four.

So é is not one group of eight bits, it is 11000011 10101001. The é is one character and two bytes, and a converter that emits a single group has thrown away half of it. A rocket emoji is four groups, thirty-two bits, one character. The statistics under the tool show characters and bytes side by side, and the ratio between them tells you immediately whether your input is plain ASCII or something wider.

The lead byte announces the length in unary: 0xxxxxxx for one byte, 110xxxxx for two, 1110xxxx for three, 11110xxx for four, with every continuation byte starting 10. That design is why UTF-8 is self-synchronising — land anywhere in a stream and you can walk backwards to the start of a character — and why the decoder here can tell you precisely which byte broke the sequence instead of replacing the whole mess with a question mark.

Reading the groups

Spaces between groups are for humans; the bytes are identical without them. Hexadecimal is the same data at a quarter of the width, which is why hex dumps exist and binary dumps do not. Octal survives mostly in file permissions and in escape sequences from older systems.

If you want to see the same numbers as arbitrary bases rather than as text, the number base converter does that. For turning bytes into something safe to paste into JSON or a URL, use the Base64 encoder and decoder instead — binary is for reading, not for transport.

Frequently asked questions

Why is the letter A written as 01000001?

Because ASCII assigned A the number 65, and 65 in base two is 1000001 — seven digits, padded to eight so that every character occupies one full byte. The choice of 65 was not arbitrary: uppercase letters begin at 64 + 1 and lowercase at 96 + 1, exactly 32 apart, so flipping bit six changes the case of any letter. That trick is why old code could lowercase a string with a single OR.

How many bits does an emoji take?

Thirty-two, in four bytes of UTF-8. An emoji lives above U+FFFF, and the four-byte form is the only one that reaches that far. Some emoji are worse: a family or a flag is several code points glued together with joiners, so one thing you see on screen can easily produce ten bytes and eighty bits. The counter above reports bytes, characters and the ratio between them for exactly this reason.

Does this convert ASCII to binary, or UTF-8?

UTF-8, which for anything you can type on a plain keyboard is byte-for-byte the same thing. ASCII covers the first 128 values, and UTF-8 was designed so those 128 encode as single bytes with the top bit clear. So an ASCII to binary conversion and a UTF-8 conversion agree completely on plain English, and only diverge the moment you paste an accent, a curly quote or a dash.

Why does my binary refuse to decode?

Usually one of three things: a group with seven digits instead of eight, a stray character that is not a zero or a one, or a run of bytes that is not valid UTF-8 — a continuation byte with no lead byte in front of it, for instance. The decoder here refuses rather than substituting the replacement character, and the message names the group or byte position at fault so you can fix that one group.

Can I convert binary back to text without spaces?

Yes. Paste an unbroken run of digits and it is sliced into bytes of eight, or into pairs for hexadecimal and triples for octal. The only requirement is that the total divides evenly: 23 binary digits cannot be a whole number of bytes, and rather than dropping the remainder the tool says how many digits are left over.

Related tools

Updated