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
Your text is processed on this device and never uploaded. It is not saved either: reload the page and it is gone.
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.
| Character | Code point | UTF-8 binary | UTF-8 hex |
|---|---|---|---|
| C | U+0043 | 01000011 | 43 |
| a | U+0061 | 01100001 | 61 |
| f | U+0066 | 01100110 | 66 |
| é | U+00E9 | 11000011 10101001 | C3 A9 |
| space | U+0020 | 00100000 | 20 |
| 😀 | U+1F600 | 11110000 10011111 10011000 10000000 | F0 9F 98 80 |
The example in every base
| Base | Bytes |
|---|---|
| Binary | 01000011 01100001 01100110 11000011 10101001 00100000 11110000 10011111 10011000 10000000 |
| Hex | 43 61 66 C3 A9 20 F0 9F 98 80 |
| Octal | 103 141 146 303 251 040 360 237 230 200 |
| Decimal | 067 097 102 195 169 032 240 159 152 128 |
How many bytes UTF-8 uses
| Code points | Bytes | Bit pattern | Example | Example in binary |
|---|---|---|---|---|
| U+0000 to U+007F | 1 | 0xxxxxxx | A (U+0041) | 01000001 |
| U+0080 to U+07FF | 2 | 110xxxxx 10xxxxxx | é (U+00E9) | 11000011 10101001 |
| U+0800 to U+FFFF | 3 | 1110xxxx 10xxxxxx 10xxxxxx | € (U+20AC) | 11100010 10000010 10101100 |
| U+10000 to U+10FFFF | 4 | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 😀 (U+1F600) | 11110000 10011111 10011000 10000000 |
Common characters in every base
| Character | Decimal | Hex | Octal | Binary |
|---|---|---|---|---|
| (space) | 032 | 20 | 040 | 00100000 |
| 0 | 048 | 30 | 060 | 00110000 |
| 9 | 057 | 39 | 071 | 00111001 |
| A | 065 | 41 | 101 | 01000001 |
| Z | 090 | 5A | 132 | 01011010 |
| a | 097 | 61 | 141 | 01100001 |
| z | 122 | 7A | 172 | 01111010 |
| ! | 033 | 21 | 041 | 00100001 |
| (new line) | 010 | 0A | 012 | 00001010 |
How to convert text to binary and back
- 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.
- 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.
- 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.
- 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.
- 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
More free tools
- Number Base ConverterConvert whole numbers between binary, octal, decimal, hex and any base from 2 to 36, up to 5,000 digits, with grouped digits and a two’s-complement view.
- Base64 Encode & DecodeEncode text or a file to Base64 and decode it back, with correct UTF-8 for emoji and any language, URL-safe and MIME variants. Runs in your browser.
- HTML Entity Encoder & DecoderEscape text for safe HTML or decode named, decimal and hex character references the way browsers do, with all 2,231 standard names. Runs in your browser.
- SMS Character CounterCount SMS segments: GSM-7 (160 / 153) or UCS-2 (70 / 67), characters left, and which characters force UCS-2, with a one-click GSM-friendly fix.
- Morse Code TranslatorTranslate text to Morse code and back, with audio at any WPM (Farnsworth too) and a full ITU-R M.1677-1 chart with punctuation, @ and SOS.
- Barcode GeneratorMake Code 128, EAN-13, UPC-A, EAN-8 and Code 39 barcodes with check digits and quiet zones. Download PNG or SVG at your size and DPI. Made on your device.