ToolsWhisper
Developer tools

Text to Binary Converter

Turn text into binary, octal, decimal or hex bytes, and back again.

  • Runs in your browser
  • Nothing is uploaded
  • Free, no sign-up
Direction
Number system
Text
Bytes
Bytes
13
Bits
104
Characters
13

Text is encoded as UTF-8: plain English letters are one byte each, while accented letters take two, most other scripts three and emoji four.

About this tool

Write any text as the bytes it is stored as, in binary, octal, decimal or hexadecimal, or paste bytes and read the text they spell. Text is encoded as UTF-8, the encoding of the web, so characters outside English convert correctly.

How to use it

  1. Choose Text → bytes or Bytes → text.
  2. Pick binary, octal, decimal or hex, and a separator for the output.
  3. Type or paste your input, then copy the result.

One character is not always one byte

UTF-8 uses between one and four bytes per character. The English alphabet, digits and common punctuation take one; most other characters take more.

Character Name UTF-8 bytes (hex) Count
A Latin capital A 41 1
é e with acute accent c3 a9 2
€ euro sign e2 82 ac 3
日 Han character e6 97 a5 3
😀 grinning face f0 9f 98 80 4

A converter that shows a single byte for é is using Latin-1, an older single-byte encoding, and its output will not match what a modern file or web page contains.

Reading bytes back into text

Bytes can be separated by spaces, commas or line breaks. Binary and hex also accept one unbroken run, which is split into groups of eight and two digits.

Each byte is checked as it is read:

  • A decimal number above 255, or a binary or hex group that is too long, is reported by name rather than being quietly truncated.
  • A run of digits that does not divide into whole bytes is rejected.
  • If the bytes are not valid UTF-8, you get an error instead of a string of replacement characters. That usually means the data was never text, or was written in a different encoding.

Binary is a representation, not a disguise

Writing text as ones and zeros does not protect it. Anyone can reverse it in a second, as this page does. For a confidential value you want encryption, and for sending bytes through something that only accepts text, the usual tool is Base64: see the Base64 encoder. To work with the numbers themselves in another base, use the number base converter.

Frequently asked questions

Is this ASCII or UTF-8?

UTF-8. For the 128 ASCII characters the two are identical, so English text produces the same bytes either way. Beyond ASCII, UTF-8 is what files and web pages actually contain.

Why do I get an invalid UTF-8 error?

The bytes you entered do not form valid UTF-8 text. Check that no digit is missing, and that the data is text at all: a byte such as ff can never appear in UTF-8.

Why is the byte count larger than the number of characters?

Characters outside basic English take two to four bytes each. The statistics show both counts so you can see the difference.

Does this work on files?

This tool is for text. You can open a plain-text file into the input with the Open button, but binary files should not be pasted in.

Related tools