Converting text to a binary file means writing the exact bytes that represent each character, not the abstract Unicode code point, into a sequence of 8-bit groups. A byte-exact converter such as the Text to Binary Converter uses the WHATWG UTF-8 encoder to serialize every character of your text into one to four bytes depending on the Unicode range, then prints each byte as eight zero-padded bits separated by a single space. ASCII letters like A become one byte, accented Latin letters such as é take two bytes, the euro sign uses three, and a supplementary-plane emoji like 😀 takes four. The output is therefore an explicit, copyable byte stream, not JavaScript UTF-16 code units, glyph pixels, or a base-2 rendering of each scalar value. Whether the final destination is a .txt dump of binary digits, a string literal embedded in source code, or a real .bin file written by a separate program, the encoded bytes are the same. The converter keeps input and output in the current browser tab, never uploads anything, and rejects invalid byte groups on the reverse path with a clear fatal error.

What "Converting Text to a Binary File" Actually Means
The phrase "binary file" can mean two very different things, and a clear answer depends on which one the question is asking. In one sense, a binary file is any non-plain-text file stored on disk — a .bin, .png, .zip, or compiled program — whose bytes are not meant to be read by humans. In another sense, when someone asks how to convert text to a binary file, they often mean a plain-text document that contains the printable characters '0' and '1' representing each byte of the original text, one byte per group.
A true binary file stores raw bytes on disk. A text file containing "binary" stores those same bytes as the ASCII characters '0' and '1', separated by spaces or newlines. The information is identical, but the on-disk encoding is different. The Text to Binary Converter produces the second kind: a copyable string of spaced 8-bit byte groups that you can paste into source code, a log file, a configuration value, or a chat message. If your final goal is a real .bin file, those spaced groups become the intermediate form that a separate program parses and writes to disk.
This distinction matters because the term is ambiguous. A byte-exact tool should always tell you which character encoding it uses and how the bits are grouped. The converter commits to UTF-8 encoding and to eight-bit groups separated by exactly one ordinary space, which makes the format fully reversible without guessing padding, trimming, or alignment.
Why UTF-8 Byte Widths Vary From One to Four
UTF-8 is a variable-width standard. A single character can occupy one, two, three, or four bytes depending on which range of Unicode it falls into, as defined by the WHATWG Encoding Standard and the Unicode Conformance specification. The table below summarizes the official byte widths used by the encoder.
| Unicode range (hex) | Byte width | Example characters |
|---|---|---|
| 0000–007F | 1 byte | ASCII letters, digits, basic punctuation, control codes |
| 0080–07FF | 2 bytes | Latin letters with accents, Greek, Cyrillic, Arabic, common symbols |
| 0800–FFFF | 3 bytes | CJK characters, the euro sign €, most math symbols |
| 10000–10FFFF | 4 bytes | Supplementary-plane emoji 😀, historic scripts, rare symbols |
ASCII "A" is one byte: 01000001. The accented letter "é" takes two bytes. Worked out as one example: é (Unicode U+00E9) is encoded in UTF-8 as the two bytes 0xC3 0xA9, which in 8-bit binary become 11000011 10101001. The euro sign "€" takes three bytes: 11100010 10000010 10101100. The "😀" emoji takes four bytes: 11110000 10011111 10011000 10000000. This is why any tool that promises "one byte per character" is wrong for almost any modern text.
The output of the converter is the encoded byte stream, not a base-2 rendering of the Unicode code point. Treating the code point as the byte value would produce four bytes for every character in the Basic Multilingual Plane, which is incorrect under UTF-8 and would not round-trip back to the original text. According to the MDN documentation for TextEncoder, the browser's standards-based encoder is the correct source for these byte sequences.
Convert Text to Binary Bytes Step by Step
The fastest path from typed text to a copyable string of 8-bit byte groups takes six actions inside the converter. Each step preserves the strict format so the byte groups can be reversed exactly.
- Open the Text to Binary Converter in your current browser tab.
- Choose the "Text to UTF-8 binary" mode in the direction selector.
- Type or paste your Unicode text into the input box — accented letters, CJK characters, and emoji are all accepted as input.
- Select the Convert button to run the standards-based TextEncoder against the input.
- Verify the byte count displayed beneath the output, which is the exact number of UTF-8 bytes in your input.
- Copy the spaced 8-bit byte groups from the output panel and paste them into source code, a log, or a separate file-writing program.
For the reverse path, switch the direction selector to "UTF-8 binary to text", paste the exact 8-bit groups separated by one ordinary space, and select Convert. The decoded text must match the byte count from the encoder; if it does not, the decoder rejects the input with a clear error message instead of producing a misleading result. The same conversion is mirrored by the Binary To Text tool, which exposes the same UTF-8 contract for readers who already have byte groups and need them decoded.
Strict Format Rules for Decoding Binary Back to Text
The decoder accepts a strict regular language: groups of exactly eight characters, each being 0 or 1, separated by exactly one ASCII space. It rejects prefixes such as "0b", commas, tabs, multiple consecutive spaces, seven-bit groups, nine-bit groups, leading or trailing whitespace, and any character other than 0 or 1. Values are never padded, trimmed, guessed, or silently discarded.
This strictness is deliberate. A byte sequence that is structurally well grouped can still be invalid UTF-8 — for example, a lone leading continuation byte without its predecessor, an overlong encoding, or a UTF-16 surrogate half. A fatal decoder surfaces these cases with a clear error rather than substituting the Unicode replacement character, which would otherwise let bad input look like valid output. The MDN reference for TextDecoder documents the fatal option used to enforce this behavior.
For protocol, source-code, or forensic work, this lets the reverse operation act as a verification step instead of a silent approximation. The encoder accepts up to 20,000 UTF-16 code units of input. The decoder accepts up to 180,000 input characters. Inputs that exceed these budgets fail before conversion. When copying the encoded groups, only systems that preserve ordinary spaces and line content exactly should receive them; chat clients and rich-text editors can collapse spaces or insert line breaks, which would make strict decoding reject the result.
When You Need a True Binary File Instead of Binary Bytes
If your goal is a real .bin file on disk, the spaced 8-bit groups are an intermediate form. Paste them into a small program — for example, a Python, Node.js, or shell script — that parses each eight-bit group as a byte with int(group, 2) and writes the bytes to disk. The converter is the encoding half of that workflow; the file-writing program is the second half.
The converter is narrow on purpose. It does not parse numeric binary values, machine instructions, image or archive files, Base64, hexadecimal, Morse code, or custom legacy character sets. The table below shows where this tool fits among its neighbors.
| Goal | Right tool |
|---|---|
| Encode text as UTF-8 8-bit binary bytes | Text to Binary Converter |
| Encode text as UTF-8 hex bytes (continuous, spaced, or 0x-prefixed) | Text to HEX |
| Encode text as canonical RFC 4648 Base64 with full UTF-8 support | Base64 Encode / Decode |
| Decode the same byte groups back to Unicode text | Binary To Text |
| Convert a local UTF-8, UTF-16, or Windows-1252 file into validated UTF-8 bytes | UTF-8 Converter |
| Translate text into Morse code with optional audio playback | Morse Code Translator |
Binary output is not encryption. The encoded bytes contain the same information as the original text and offer no secrecy, authentication, integrity, compression, or password protection; anyone holding the byte groups can decode them. For protocol, source-code, or forensic work, verify the actual byte sequence against the relevant specification and the destination system rather than relying on how a font draws the binary output, since font rendering can mislead readers about the byte width of a glyph.
For a deeper look, see Text to Hex Cheat Sheet: UTF-8 Values and Format Reference.