Home ↓
CalculatorsVerified

Tech & Digital

Text to Binary, Hex and ASCII Converter (UTF-8)

See how text is stored inside a computer. Every character you type is stored as one or more bytes, and every byte is a pattern of eight binary digits, or bits. The mapping from characters to numbers is defined by Unicode, which gives every character in every writing system a unique code point, such as U+0041 for the capital letter A or U+00E9 for é. Those code points are then stored as bytes using an encoding, and by far the most common on the web is UTF-8, which keeps the 128 basic ASCII characters, English letters, digits and common punctuation, in a single byte identical to the original ASCII code, and uses two, three or four bytes for accented letters, other alphabets, Chinese characters and emoji. This converter shows text as binary, hexadecimal and decimal bytes in UTF-8, together with the Unicode code point of each character and a character-by-character table. It also works in reverse: paste binary digits or hexadecimal bytes, with or without spaces, and it decodes them back into text. It is useful for learning how computers represent data, for computer science homework, for debugging character-encoding problems such as garbled accents, and for fun secret messages. The word Hi, for example, is 01001000 01101001 in binary.

How to use this calculator

  1. Choose text to binary, binary to text or hex to text.
  2. Paste your text, binary digits or hex bytes.
  3. Read the binary, hex and decimal values.
  4. See the Unicode code point of each character.
  5. Use the table to inspect each character’s bytes.

ASCII and Unicode

ASCII, standardised in the 1960s, defined 128 characters for English. Many incompatible extensions followed for other languages, which caused the garbled text, called mojibake, still seen when files are opened with the wrong encoding.

Unicode now covers well over 100,000 characters, and UTF-8 is used by the vast majority of web pages.

Reading binary

Each binary digit stands for a power of two, from 128 on the left to 1 on the right. 01000001 is 64 + 1 = 65, the code for A.

Hexadecimal is a compact way to write bytes: each hex digit stands for exactly four bits.

Formula & method

Text is encoded as UTF-8: ASCII characters use one byte, others two to four bytesEach byte is shown as 8 binary digits or 2 hexadecimal digitsUnicode code point U+XXXX identifies each character independently of encodingFor binary or hex input, spaces between bytes are optional

Unicode assigns each character a code point, written U+ followed by at least four hexadecimal digits. UTF-8 encodes code points U+0000–U+007F in 1 byte (0xxxxxxx), U+0080–U+07FF in 2 bytes, U+0800–U+FFFF in 3 bytes and higher code points, such as most emoji, in 4 bytes. Each byte is shown as 8 binary digits (00000000 to 11111111), 2 hexadecimal digits (00 to FF) or a decimal number (0 to 255). ASCII codes: A = 65 = 0x41 = 01000001; a = 97 = 0x61; space = 32 = 0x20; 0 = 48 = 0x30. For binary and hex input, spaces, commas and 0x prefixes are ignored.

Worked example

Converting “Hi!”

  1. H = 72 = 0x48 = 01001000.
  2. i = 105 = 0x69 = 01101001.
  3. ! = 33 = 0x21 = 00100001.

Answer: 01001000 01101001 00100001, or 48 69 21 in hex.

Frequently asked questions

What is A in binary?

01000001.

What is UTF-8?

The most common way to store Unicode text as bytes.

Why does é use two bytes?

UTF-8 uses two bytes for characters beyond ASCII up to U+07FF.

What is a code point?

The unique number Unicode assigns to a character.

Can I convert binary back to text?

Yes, choose binary to text and paste the bits.

How many bytes is an emoji?

Usually four in UTF-8.