Utilia

Text to Binary, Hex and ASCII

Convert text to binary, hexadecimal, decimal or octal codes and back, with UTF-8 bytes or Unicode code points, custom separators and a character table.

Characters
0
Code points
0
UTF-8 bytes
0
Character table
CharacterCode pointDecimalUTF-8 (hex)UTF-8 (binary)

How to use the text to binary converter

  1. Type or paste your text in the input box, then click Text → codes. The result appears below and updates as you type.
  2. Choose the Format: Binary (base 2), Hexadecimal (base 16), Decimal (base 10) or Octal (base 8).
  3. Under Codes represent, keep UTF-8 bytes (ASCII compatible) for the usual “text to binary” output, or pick Unicode code points to get one number per character.
  4. Pick a Separator (Space, None, Comma or New line), and tick Add a prefix (0b, 0o, 0x) if you need codes written the way programming languages expect them.
  5. To go the other way, paste the codes and click Codes → text. The tool guesses the format when you switch, and you can correct it in Format.

Copy copies the result, and Use the result as input swaps the result into the input box and reverses the direction, which is a quick way to check a round trip. The Character table lists each character with its code point, its decimal value and its UTF-8 bytes in hex and binary.

ASCII, Unicode and UTF-8

Computers store text as numbers. ASCII, defined in the 1960s, gives a number from 0 to 127 to the English letters, digits, punctuation and a few control characters: “H” is 72, which is 01001000 in binary and 48 in hexadecimal. ASCII has no room for é, ç, € or emoji, so today’s text uses Unicode, which gives every character a code point, written like U+00E9 for é.

UTF-8 is the way almost every web page and file stores those code points as bytes. Its key property is compatibility: the 128 ASCII characters keep their single byte, so “Hello” gives exactly the same binary in ASCII and in UTF-8. Other characters take 2 to 4 bytes: é is C3 A9 (two bytes), € is E2 82 AC (three) and 😀 is F0 9F 98 80 (four). The tool tells you how many characters fall outside ASCII, and the counters show the number of Characters, Code points and UTF-8 bytes. These can differ: 👍🏽 is one visible character made of two code points and eight bytes.

Decoding codes back to text

When decoding, codes can be separated by spaces, commas, semicolons or line breaks. Prefixes such as 0b, 0x, \x, U+ and HTML entities like H or H are removed automatically. Binary and hexadecimal bytes can also be pasted without separators: 0100100001101001 is split into groups of 8 bits, and c3a9 into pairs of hex digits.

The tool checks every code and tells you exactly which one is wrong: a digit that doesn’t belong to the chosen base, a byte above 255, a group that can’t be split evenly, or a code point beyond U+10FFFF. If the bytes are valid numbers but don’t form valid UTF-8 (for example C3 followed by 28), the text is still shown with � in place of the broken sequence, and a message explains why.

Examples

  • “Hi” in binary: 01001000 01101001
  • “Hi” in hexadecimal: 48 69
  • “Hi” in decimal: 72 105
  • “é” as UTF-8 bytes in hex: C3 A9; as a code point: E9

Frequently asked questions

What is the difference between ASCII and binary?

ASCII is a table that assigns numbers to characters. Binary is just a way to write those numbers with 0 and 1. Converting text to binary means looking up each character’s number and writing it in base 2.

Why does é take 16 bits instead of 8?

In UTF-8, only the 128 ASCII characters fit in one byte. Accented letters need two bytes, so é becomes 11000011 10101001. With Unicode code points, é is the single number 11101001 (233).

Can I decode binary without spaces?

Yes, for bytes in binary or hexadecimal, as long as the length is a multiple of 8 bits or 2 hex digits. Decimal codes need a separator, unless each one is written with exactly 3 digits.

Which option matches "text to hex" in programming?

UTF-8 bytes in hexadecimal. It gives the same result as encoding a string to UTF-8 in Python, JavaScript or most other languages.

Is my text uploaded?

No. The conversion runs entirely in your browser; nothing is sent over the network.