Binary Text Converter

Convert text into eight-bit binary and back again. The output is one group per UTF-8 byte rather than one per character, which is the difference between a converter that round-trips and one that does not: an accented letter is two bytes and an emoji is four, so those correctly produce more groups than they have characters. Tools that work per character mangle both, and on emoji they split the character into surrogate halves that are not characters at all. Decoding accepts whatever separator you have — spaces, newlines, hyphens, or nothing — and tells you the exact bit count if it is not a whole number of bytes, which is almost always a digit typed twice or dropped. The same bytes are shown in hex alongside, since that is what a hex editor or debugger will show you.

Bytes per character in UTF-8

CharacterBytesBinary groups
A101000001
é2Two groups
日3Three groups
🎉4Four groups
Space100100000

When to use it

  1. See the actual bit pattern of a piece of text.
  2. Decode binary from a puzzle, a CTF or a homework exercise.
  3. Check how many bytes a string takes in UTF-8.
  4. Compare a string against what a hex editor is showing.
  5. Teach or learn how character encoding works.

How to Use

  1. Pick a direction — text to binary, or binary to text.
  2. Paste your input.
  3. Copy the result, or the hex view beneath it.

Features

  1. One group per UTF-8 byte, so the round trip is exact
  2. Handles accents, CJK and emoji correctly
  3. Decoding tolerates any separator or none
  4. Exact bit count reported when the input is not whole bytes
  5. Matching hexadecimal view
  6. Invalid UTF-8 reported rather than silently replaced
  7. 100% client-side

FAQs

Is my text uploaded?

No. Everything runs in your browser.

Why does one character produce several groups?

Because binary represents bytes, and many characters take more than one byte in UTF-8. An accented Latin letter takes two, most CJK characters three, and an emoji four. Producing one group per character would make the result impossible to decode back.

Does the separator matter?

Only for readability. Decoding strips everything that is not a 0 or a 1, so spaced, unspaced, newline-separated or hyphenated input all work identically.

I get an error about a multiple of 8.

Your input is not a whole number of bytes, so it cannot represent text. The message gives the exact bit count — almost always a digit accidentally doubled or dropped, and knowing the number makes it easy to find.

Why do some converters give different output for emoji?

Because they read JavaScript's UTF-16 string units rather than UTF-8 bytes. That splits an emoji into two surrogate halves, neither of which is a real character, and the output cannot be decoded back correctly.

Technical Details

Text is encoded to UTF-8 bytes first, and one eight-bit group is emitted per byte. That distinction is the whole correctness story. Converting per character instead — reading each JavaScript string index and writing its code unit — produces a single group for an accented letter that actually occupies two bytes, and two groups for an emoji that occupies four, and in both cases the output cannot be decoded back to what went in. Because JavaScript strings are UTF-16, the per-character approach also splits any astral character into two surrogate halves, each of which is not a character at all. Working in bytes avoids all of it: an accented letter produces two groups, an emoji four, and the round trip is exact. Decoding strips everything that is not a zero or a one, so input separated by spaces, newlines, hyphens or nothing at all is handled identically, and then checks that the remaining bit count is a multiple of eight — reporting the actual count when it is not, since a stray or missing digit is the usual cause and knowing the number makes it findable. The resulting bytes are decoded as UTF-8 in fatal mode, so an invalid sequence is reported rather than silently replaced with substitution characters that would look like a successful decode. The same bytes are also shown in hexadecimal, because hex is what a debugger or hex editor will display and comparing the two is often the point. Nothing is uploaded.

Developer Tools

Developer Tools

  • HTML Entities Encoder
  • Number Base Converter
  • JSON Tree Viewer
  • JSON Flattener
  • JSON Diff Checker
  • JSONPath Extractor
  • JSON Schema Generator
  • License Generator