Skip to main content

Free Binary to Text Converter

Convert text to binary (0s and 1s) and back. Supports UTF-8 encoding. See the byte and bit count for any text.

Works offline once loaded
Format:
Separate bytes by:
Binary output
01001000 01100101 01101100 01101100 01101111
5 characters5 bytes40 bits

Common uses

  • Learn Binary for Computer ScienceUnderstand how computers store text as binary — see exactly how letters map to 8-bit ASCII bytes.
  • Binary Code Puzzles and CiphersEncode secret messages in binary for escape rooms, puzzles, and code-breaking games.
  • Binary Representation in NetworkingSee how text data is represented in binary at the network layer — useful for protocol analysis.
  • Text Steganography with BinaryHide text messages in binary data streams — an introduction to steganographic encoding concepts.
  • Understanding Binary Data TransmissionSee how text is encoded to binary bytes for transmission across serial lines, Bluetooth, and radio.

How It Works

Conversion runs entirely in your browser using the Web API's built-in TextEncoder and TextDecoder — the same UTF-8 encoding engine used by every modern browser. No library is imported; the chunking, radix conversion, and byte parsing are all hand-written JavaScript running locally.

  1. 1
    TextEncoder encodes your text
    When converting text to bytes, the browser's TextEncoder.encode() maps every character — including emoji and non-ASCII scripts — to its UTF-8 byte sequence. This is the same code path browsers use internally when sending form data.
  2. 2
    Hand-written chunker formats the bytes
    Each byte value is converted to the selected base (binary via toString(2), hex via toString(16), octal via toString(8), or decimal) and padded to a fixed width. A grouping option controls whether bytes are separated by spaces, newlines, nibble gaps (4-bit pairs), or nothing.
  3. 3
    Parser reconstructs bytes for the reverse direction
    Going from encoded form back to text, a hand-written parser strips separators and splits the input into fixed-width chunks (8 chars for binary, 2 for hex, 3 for octal) or whitespace-delimited tokens for decimal. Each chunk is parsed with parseInt() at the correct radix, validated to be in the 0–255 range, and placed into a Uint8Array.
  4. 4
    TextDecoder validates and outputs UTF-8
    The Uint8Array is passed to TextDecoder('utf-8', { fatal: true }), which throws if the byte sequence is not valid UTF-8 — catching cases like a binary input that forms an invalid multibyte sequence. A character, byte, and bit count is shown below the output.

Related Tools

Frequently Asked Questions