Text to Binary, Hex & ASCII Converter

Type text and press Convert to see it as binary, hexadecimal, decimal (ASCII), and octal codes, or switch to Codes → Text to read codes back. Accented letters, other scripts, and emoji are encoded as UTF-8.

Try an example

About this text to binary converter

Computers store text as numbers. Each character is first given a code point by Unicode, then written as bytes using UTF-8, the encoding used by almost every website. Plain English letters, digits, and punctuation take one byte each and match the old ASCII table, so “A” is 65 in decimal, 41 in hex, and 01000001 in binary. Accented letters take two bytes, most other scripts three, and emoji four. This converter shows every byte in binary, hexadecimal, decimal, and octal, lists each character with its code point, and decodes codes back to text, checking that the bytes form valid UTF-8.

How to convert text to binary or hex

  1. Choose a direction. Pick Text → Codes to encode text, or Codes → Text to decode binary, hex, decimal, or octal codes.
  2. Enter your text or codes. Type or paste, or press an example. When encoding, choose the main format, the separator, padding, and prefix options.
  3. Press Convert. Copy the result, check all four formats and the character table, or press Use result as input to convert it back.

Frequently asked questions

How is “Hi” written in binary?

H is 72 and i is 105 in ASCII, which are 01001000 and 01101001 in 8-bit binary. So “Hi” becomes 01001000 01101001.

Why does an emoji turn into four bytes?

UTF-8 uses one byte for ASCII characters and two to four bytes for everything else. Emoji have large code points, such as U+1F680 for 🚀, so they need four bytes: F0 9F 9A 80.

Can I decode codes without spaces?

Yes, for binary and hex. A long run of digits is read 8 binary digits or 2 hex digits at a time. Decimal and octal codes need a separator because their lengths vary.

What is the difference between ASCII and UTF-8?

ASCII defines 128 characters, numbered 0 to 127. UTF-8 is compatible with it, so those characters have the same codes, but it can also encode every other Unicode character using extra bytes.

What do the 0b, 0x, and 0o prefixes mean?

They mark the base of a number in many programming languages: 0b for binary, 0x for hexadecimal, and 0o for octal. Turn on the prefix option to paste codes straight into code.