Skip to content

Convert text to binary

Translate text into binary with UTF-8 or ASCII, 7 or 8-bit groups and any separator — plus a file input, which most binary tools lack.

  • Runs in your browser
  • Nothing you enter is sent
  • Free, no account
Text → Binary
Translation happens as you type. Swap sends the result back into the input and reverses the direction.

The translation appears here.

Options

Always eight bits per byte. Accented letters, CJK and emoji take two to four bytes each — the same bits a file on disk would hold.

Applies to generated output. Input is parsed with any spacing at all — every non-binary character is ignored.

Load from a file
Drop a .txt file to translate its contents. Read locally — nothing is uploaded.
Drop a text file hereFirst 64 KB are loaded.TXT, LOG, CSV, MD · up to 16 MB each

How text becomes binary

Every character has a numeric code. That number is written in base 2 — ones and zeros — and padded to a fixed width so a reader knows where one character ends and the next begins. With 8-bit groups, the letter A (code 65) becomes 01000001.

H  →  72  →  01001000
e  → 101  →  01100101
l  → 108  →  01101100
l  → 108  →  01101100
o  → 111  →  01101111

Reading a byte

The place values double from the right: 1, 2, 4, 8, 16, 32, 64, 128. Add up the columns that hold a 1 and you have the character code.

1286432168421Total
0100100064 + 8 = 72 = H
0110010164+32+4+1 = 101 = e

7-bit or 8-bit?

Original ASCII was a 7-bit code — 128 characters, which covered English and not much else. The eighth bit of a byte was a parity bit for error checking on serial lines. When memory got cheaper the parity bit was repurposed to extend the character set, and 8 bits became the norm.

  • Choose 8-bit when the binary represents bytes as a computer stores them.
  • Choose 7-bit for classroom exercises that follow the original ASCII table.

The two differ only by a leading zero for characters below 128 — but a decoder set to the wrong width will produce nonsense.

Unicode makes strings longer than they look

In UTF-8, only plain ASCII is one byte. Everything else takes more, and the binary shows it immediately:

CharacterUTF-8 bytesBits
A18
é216
字324
😀432
👨‍👩‍👧18144

That last row is a family emoji: three people joined by two zero-width joiners. It is one “character” on screen and eighteen bytes on disk, which is why character limits and byte limits are not the same thing.

Binary hides nothing

Converting text to binary is not obfuscation. It is the same information in base 2, reversible by anyone in a second — including on the binary-to-text page next door. Treat it as a way of looking at data, not a way of protecting it.

Translating a file

Drop a text file to convert its contents, up to the first 64 KB. Binary is eight characters per byte, so a megabyte of input would produce eight million characters — more than any browser will render comfortably, and more than any editor will accept as a paste.

Questions

Should I choose 7-bit or 8-bit groups?

8-bit if the result represents bytes, which is what a computer actually stores. 7-bit if you are working through a classic ASCII exercise, where the top bit was originally a parity bit.

Why does one emoji produce 32 bits?

In UTF-8 most emoji are four bytes, and four bytes is 32 bits. Composite emoji — flags, families, skin tones — are several codepoints joined together and can run to 100 bits or more.

Is binary a form of encryption?

No. It is the same data written in base 2, fully reversible by anyone, including on this page. It hides nothing.

Can I translate a whole file?

Yes, up to the first 64 KB. Binary is eight characters per byte, so a 1 MB file would produce eight million characters and no browser would render that comfortably.