Text & Utilities

Text to Binary & Hex Converter

Convert text to binary, hexadecimal, octal or decimal codes and back, with UTF-8, UTF-16 and code point modes.

Text
Binary13 units
CharUnicode code pointsUTF-8BinaryDecimal
HU+0048480100100072
eU+00656501100101101
lU+006C6C01101100108
lU+006C6C01101100108
oU+006F6F01101111111
,U+002C2C0010110044
␠U+0020200010000032
世U+4E16E4 B8 9611100100 10111000 1001011019990
界U+754CE7 95 8C11100111 10010101 1000110030028

About this tool

Computers store text as numbers. This converter shows those numbers: type a word and you see the bytes behind it in binary, hexadecimal, octal or decimal. Paste a row of 0s and 1s or hex pairs and it turns them back into readable text. Students use it to check homework on number systems, developers use it to inspect what a string really contains, and puzzle fans use it to decode binary messages.

Most online converters only handle plain ASCII. This one works with any language and with emoji, because it encodes text as UTF-8 by default, the encoding used by almost every web page. You can switch to UTF-16 code units (how JavaScript, Java and Windows store strings) or to Unicode code points (one number per character).

How to use Text to Binary & Hex Converter

  1. Choose a direction: "Text → Code" to encode, or "Code → Text" to decode.
  2. Pick the number format (binary, hex, octal or decimal) and the encoding. UTF-8 bytes is right for most cases.
  3. Type or paste your input. The result updates as you type; when decoding, the format is detected automatically and invalid groups are listed instead of silently dropped.
  4. Use Swap to send the result back as input, check the per-character table under the boxes, or open the ASCII table for a quick reference.

Examples

Text to binary

Input
Hi
Result
01001000 01101001

H is 72 and i is 105 in ASCII; each byte is written as 8 bits.

Hex to text

Input
48 65 6C 6C 6F
Result
Hello

A Chinese character in UTF-8

Input
中
Result
Hex: E4 B8 AD · Binary: 11100100 10111000 10101101

Characters outside ASCII take 2 to 4 bytes in UTF-8.

Bytes, code units and code points

A code point is the number Unicode assigns to a character: é is U+00E9 and 😀 is U+1F600. An encoding decides how that number is stored. UTF-8 uses one byte for ASCII and up to four for everything else, so é becomes C3 A9. UTF-16 uses 16-bit units, and characters beyond U+FFFF, such as most emoji, need two of them: 😀 is stored as D83D DE00, a so-called surrogate pair.

This is why the same text can give different binary output depending on the setting. If you are matching a value from a programming language, choose the encoding that language uses: UTF-8 for files, network data and most databases; UTF-16 for JavaScript string lengths and Windows APIs.

Reading binary and hex quickly

  • One hex digit is exactly four bits, so a byte is always two hex digits: 0100 1000 = 4 8 = 0x48.
  • In ASCII, uppercase letters start at 0x41 (A) and lowercase at 0x61 (a). The two differ only in one bit (0x20).
  • Digits 0–9 are 0x30–0x39, so the byte for "7" is 0x37, not 7.
  • Binary without spaces is cut into 8-bit groups automatically, and prefixes such as 0x, 0b or \x are ignored when decoding.

Frequently asked questions

Everything you need to know about this tool and data security.

Why does an emoji turn into four bytes?

Emoji have code points above U+FFFF. UTF-8 needs four bytes for those (😀 = F0 9F 98 80), and UTF-16 needs two 16-bit units. Some emoji are built from several code points joined together, so they produce even more bytes.

What happens if I decode bytes that are not valid UTF-8?

Invalid sequences are shown as the replacement character �, exactly as a browser would display them. Values that are not numbers in the chosen base, or bytes larger than 255, are skipped and listed under the result.

Is binary code a kind of encryption?

No. Binary and hex are just other ways of writing the same numbers, and anyone can turn them back into text. Use real encryption, such as AES, if the content must stay secret.

Is my text sent anywhere?

No. All conversion happens in your browser with JavaScript, so it also works offline once the page has loaded.

Is my data safe when using this tool?

Yes, 100% safe. This tool operates entirely inside your web browser using client-side JavaScript and WebAssembly. Your data never touches any external server.