Skip to main content
ponderloop

Text to Binary Converter

To convert text to binary, write each character as its UTF-8 bytes in base 2: “Café 😀” (6 characters) becomes 10 bytes, 01000011 01100001 01100110 11000011 10101001 00100000 11110000 10011111 10011000 10000000. Letters and digits take one byte, “é” takes two and an emoji takes four, so the byte count is not the character count. The same bytes can be shown as hexadecimal, octal or decimal, and the converter works backwards too: paste binary or hex and read the text, with invalid UTF-8 replaced by U+FFFD and reported. Choose UTF-16 code units instead if that is what you need. Nothing leaves your browser.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

Stays in your browser

Your text is processed on this device and never uploaded. It is not saved either: reload the page and it is gone.

Direction
Number base
Encoding
Output format

Result

6 characters became 10 bytes in UTF-8, shown as binary.

Character by character

Each character with its Unicode code point and its UTF-8 bytes, for text up to 100 characters.

CharacterCode pointUTF-8 binaryUTF-8 hex
CU+00430100001143
aU+00610110000161
fU+00660110011066
éU+00E911000011 10101001C3 A9
spaceU+00200010000020
😀U+1F60011110000 10011111 10011000 10000000F0 9F 98 80

The example in every base

“Café 😀” as 10 UTF-8 bytes, space-separated and padded. Computed with the same code as the tool.
BaseBytes
Binary01000011 01100001 01100110 11000011 10101001 00100000 11110000 10011111 10011000 10000000
Hex43 61 66 C3 A9 20 F0 9F 98 80
Octal103 141 146 303 251 040 360 237 230 200
Decimal067 097 102 195 169 032 240 159 152 128

How many bytes UTF-8 uses

The byte layouts from RFC 3629. The x bits carry the code point. The example bytes are computed.
Code pointsBytesBit patternExampleExample in binary
U+0000 to U+007F10xxxxxxxA (U+0041)01000001
U+0080 to U+07FF2110xxxxx 10xxxxxxé (U+00E9)11000011 10101001
U+0800 to U+FFFF31110xxxx 10xxxxxx 10xxxxxx€ (U+20AC)11100010 10000010 10101100
U+10000 to U+10FFFF411110xxx 10xxxxxx 10xxxxxx 10xxxxxx😀 (U+1F600)11110000 10011111 10011000 10000000

Common characters in every base

ASCII characters are one byte, and their UTF-8 bytes equal their ASCII codes.
CharacterDecimalHexOctalBinary
(space)0322004000100000
00483006000110000
90573907100111001
A0654110101000001
Z0905A13201011010
a0976114101100001
z1227A17201111010
!0332104100100001
(new line)0100A01200001010

How to convert text to binary and back

  1. Choose the direction. Pick “Text to bytes” to turn text into numbers, or “Bytes to text” to read binary, hex, octal or decimal values as text.
  2. Pick the number base and encoding. Choose binary, hex, octal or decimal. Keep UTF-8 (the web standard) unless you need UTF-16 code units.
  3. Type or paste. The result updates as you type. Set the separator (space, none, comma or new line) and whether each value is padded to a full byte.
  4. Check the table and the messages. The per-character table shows each character’s code point and UTF-8 bytes. When decoding, invalid values are listed with their position.
  5. Copy the result. Use Copy to put the result on the clipboard, or Swap to convert the result back.

Frequently asked questions

How do you convert text to binary?
Look up each character’s code point, encode it as UTF-8 bytes and write each byte in base 2, padded to 8 digits. “A” is code point 65 (U+0041), the single byte 01000001. Characters outside ASCII use two to four bytes.
Why does “é” give two bytes and an emoji four?
UTF-8 uses one byte for U+0000 to U+007F, two for up to U+07FF, three for up to U+FFFF and four above that (RFC 3629). “é” is U+00E9, so it is the two bytes C3 A9 (11000011 10101001). 😀 is U+1F600 and takes the four bytes F0 9F 98 80.
What is the difference between UTF-8 and UTF-16 here?
UTF-8 produces bytes (0 to 255). UTF-16 produces 16-bit code units: a character in the Basic Multilingual Plane is one unit, and an emoji or other character above U+FFFF is a surrogate pair of two units. The code units are shown as plain numbers, with no byte-order mark and no byte order: 😀 is D83D DE00.
What input can I decode?
Values separated by spaces, commas, semicolons or new lines, or an unbroken run (binary in multiples of 8 digits, hex in pairs, octal in groups of 3). Prefixes 0b, 0x, 0o and \x are accepted, and a prefix switches that entry’s base, so “0x48 0b01101001” works in any mode. Hex digits can be upper or lower case.
What happens with invalid UTF-8?
Bytes that cannot be UTF-8, such as a lone continuation byte 0x80, a cut-off sequence like C3 on its own, an overlong form like C0 AF, a surrogate (ED A0 80) or a value above U+10FFFF, are replaced by the replacement character U+FFFD. The tool lists each one with its byte position and says how many were replaced.
Does the binary include a space between bytes?
Your choice. Space is the default because it is easiest to read; None gives one unbroken string, and Comma or New line suit code and lists. Padding to 8 digits keeps every byte the same width so a string without separators can be split back into bytes.
Can I paste a lot of text?
Yes. The conversion is linear in the length of the text, so hundreds of thousands of characters stay responsive. The per-character table is only built for up to 100 characters.
Is my text sent anywhere?
No. Conversion runs in your browser and nothing is uploaded or stored; reload the page and it is gone. The only thing the site records, if you allow analytics, is that a button was used, never any of the text.

How it works

Encoding uses the browser’s TextEncoder for UTF-8 (the Encoding Standard form of RFC 3629), or reads the string’s UTF-16 code units directly. Unpaired surrogates, which no valid encoding can represent, are replaced by U+FFFD first and reported. Each unit is then written in base 2, 16, 8 or 10 (hex in capitals), optionally padded with leading zeros to 8 binary digits, 2 hex, 3 octal or 3 decimal for UTF-8 (16, 4, 6 and 5 for UTF-16), and joined with the chosen separator in one pass. Decoding reads entries separated by whitespace, commas or semicolons, splits unseparated runs into whole values, checks each against the 0 to 255 byte range (0 to 65535 for UTF-16) and skips and reports anything else. Bytes are decoded as strict UTF-8 as defined by the Unicode Standard (Table 3-7, well-formed byte sequences): overlong forms, surrogates and values above U+10FFFF are invalid, and each maximal invalid subsequence becomes a single U+FFFD, the same as browsers do. A leading byte-order mark is kept as a character, not removed.

Sources

All toolsHome & DIY calculators