Convert text to binary

Paste any text and get the matching binary representation back. The text to binary converter walks every character, takes its UTF-16 char code, and writes that number in base 2. By default each chunk is zero-padded to 8 bits and separated by a single space, so the result reads as a clean stream of 8-bit bytes. The transform runs in your browser; nothing uploads.

Input
Line 1:1 LF cloud_done Saved locally
Result Text to Binary
0 lines 0 chars

Text to binary, plain and predictable

Text to binary encoding walks every character of your input, reads its UTF-16 char code with charCodeAt, and writes that integer as a base-2 string. ASCII characters (codes 0 through 127) fit in 7 bits, Latin-1 characters fit in 8, and the rest of the Basic Multilingual Plane fits in up to 16. The default behaviour pads every chunk to 8 bits with leading zeros, which is the format most binary-to-text decoders expect; non-ASCII characters above code 255 expand to a longer chunk because their value does not fit in 8 bits.

Two toggles change the output shape. The Pad Bytes toggle, on by default, zero-pads every chunk to 8 bits. Turn it off to emit the minimum number of bits per character, which is shorter but harder to round-trip without a known width. The Separate toggle, on by default, puts a single space between every chunk so the output reads as a stream of bytes. Turn it off to emit a continuous run of 1s and 0s with no delimiter.

Whitespace inside your text encodes the same way as any other character: a space is char code 32, which is 00100000. Newlines are char code 10 (00001010) or 13 (00001101) depending on whether the source uses LF or CRLF. For the inverse direction, see binary to text.

How to use convert text to binary

  1. 1Paste your text into the input panel on the left.
  2. 2The binary stream appears in the output panel on the right as you type.
  3. 3Toggle Pad Bytes to zero-pad every chunk to 8 bits or to emit the minimum width.
  4. 4Toggle Separate to insert a space between chunks or to emit a continuous run.
  5. 5Click Copy in the output header to copy the binary stream.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

UTF-16 char codes via charCodeAt

Each character is read with charCodeAt(0), which returns the UTF-16 code unit value. That means ASCII text encodes to values 0 through 127, Latin-1 to 0 through 255, and the rest of the Basic Multilingual Plane to up to 65535. Above-BMP characters encode as two 16-bit surrogate code units, one chunk each.

Pad Bytes toggle for fixed 8-bit chunks

On by default. Zero-pads every chunk to 8 bits with padStart(8, "0") so ASCII characters always emit a clean byte. Turn it off to emit the minimum number of bits per character, which is shorter but harder to round-trip when chunk widths vary.

Separate toggle for chunk delimiters

On by default. Inserts a single space between every chunk so the output reads as a stream of bytes. Turn it off to emit a continuous run of 1s and 0s. The decoder side accepts both forms, but a continuous run needs a known chunk width to round-trip.

Above-byte characters expand naturally

A character whose char code is above 255 needs more than 8 bits. With padding on, the converter pads to the next multiple of 8 needed for the value (16 bits for code unit values 256 through 65535). With padding off, the chunk is just the minimum width.

Runs entirely in your browser

No upload, no server-side processing, no log of what you pasted. The encode runs on every keystroke via a single JavaScript pass. Long inputs of a few hundred kilobytes still encode in under a second on a desktop browser.

Worked example

Two characters become two 8-bit chunks: H is char code 72, i is char code 105.

Input
Hi
Output
01001000 01101001

Settings reference

Setting or rule Effect on output
Pad Bytes (default on) Zero-pads every chunk to 8 bits. Turn off to emit the minimum number of bits per character.
Separate (default on) Inserts a single space between chunks. Turn off to emit a continuous run of 1s and 0s.
Encoding UTF-16 code unit value of each character via charCodeAt, then toString(2).
ASCII characters Encode in 7-8 bits. Pad Bytes on emits 8-bit chunks; Pad Bytes off emits the minimum width.
Above-byte characters Need more than 8 bits. With padding on, the chunk grows to the next sufficient width.
Whitespace and newlines Encode as their char code: space is 32, LF is 10, CRLF is 13 + 10. No special handling.
Empty input Emits an empty string.

FAQ

Does it work on accented characters?
Yes. e is char code 101 (01100101), e-acute is char code 233 (11101001). Both fit in 8 bits, so Pad Bytes on emits 8-bit chunks for both. Characters above code 255 need wider chunks, which the converter produces automatically when padding is on.
What does Pad Bytes do?
When on, every chunk is zero-padded to 8 bits with padStart(8, "0"). That keeps ASCII output regular and round-trippable to a fixed-width binary decoder. When off, each chunk is the minimum number of bits needed to represent the char code, which is shorter but ambiguous without a known width.
What does Separate do?
When on, a single space goes between every chunk so the output reads as a stream of bytes. When off, the output is a continuous run of 1s and 0s with no delimiter. The decoder accepts both forms, but the continuous run needs a known chunk width to round-trip.
Is the text sent anywhere?
No. The encode runs entirely in your browser via JavaScript. Nothing is uploaded, nothing is logged, no record of your text exists on our servers.
How do I go the other way?
Paste your binary stream into binary to text. That tool splits on whitespace, parses each chunk as base 2, and emits the matching character via String.fromCharCode.