String Functions
String to Binary Converter
Convert any string to its binary representation, byte by byte (space-separated).
About converting strings to binary
This tool converts any string into binary, one byte at a time. Paste text in and it returns a space-separated list of 8-bit groups, one per byte of the UTF-8-encoded input, in order — Hi becomes 01001000 01101001. Every character is converted, including line breaks, which appear as their own byte (\n is 00001010). The whole operation runs in your browser — nothing you type is sent to a server.
The input first goes through the TextEncoder API, which encodes the string to raw UTF-8 bytes — the encoding used on the wire for HTML, JSON and most web text. Each byte is then written as exactly eight binary digits, left-padded with zeros, the same fixed-width form an ASCII table shows. Accented letters, symbols and emoji take two to four bytes in UTF-8, so they expand into two to four groups.
Byte-level binary is useful for verifying a custom encoder, debugging a binary protocol, or checking exactly how many bytes a piece of text takes. The bytes are the same ones the Binary to Hex Converter shows, just written in base 2 instead of base 16.
Examples
Input: Hi!
Output: 01001000 01101001 00100001
H (byte 72) → 01001000
i (byte 105) → 01101001
! (byte 33) → 00100001Each byte is padded to 8 digits, so every group has the same width.
Input: é
Output: 11000011 10101001
Input: a⏎b (a, a line break, b)
Output: 01100001 00001010 01100010é is two bytes in UTF-8 (0xC3 0xA9), so it gives two groups. A line break is its own byte, 00001010.
const bytes = new TextEncoder().encode('Hi!');
[...bytes].map((b) => b.toString(2).padStart(8, '0')).join(' ');
// → "01001000 01101001 00100001"charCodeAt() is not equivalent for non-ASCII input: it reads UTF-16 code units, not UTF-8 bytes.
Frequently asked questions
Why does every group have exactly 8 digits?
Each UTF-8 byte is written as a fixed-width 8-bit group, padded with leading zeros, so ! (byte 33) is 00100001. This matches a standard ASCII-to-binary table.
What happens to line breaks in my text?
They are converted like any other character. A line feed is 00001010 and a carriage return is 00001101, so multi-line input keeps every line break in the output.
Why does one accented letter or emoji turn into two or more binary groups?
The tool encodes the input to UTF-8 bytes first, then writes each byte, not each visible character. ASCII characters are 1 byte, but accented letters, symbols and emoji take 2 to 4 bytes.
Is this the same as a standard ASCII-to-binary table?
For plain ASCII text, yes: each byte is 0 to 127 and matches the table exactly. Outside ASCII, the tool follows UTF-8 byte encoding rather than a one-character-to-one-byte mapping.
Does this tool send my text to a server?
No. The conversion runs entirely in your browser using the TextEncoder API — nothing you type is uploaded, logged, or stored.