Skip to content

Text to Binary Converter

Convert text to binary, hex, octal or decimal codes and back. Runs in your browser.

Loading tool…

About this text to binary converter

This text to binary converter turns any text into binary, hex, octal or decimal codes, and turns those numbers back into text. It handles accents, other alphabets and emoji properly, because it works from the UTF-8 bytes your computer actually stores.

Below the result, a table breaks every character into its code point and its bytes, so you can see why A is one byte, é is two and 😀 is four. Pick the separator you want, add 0b or 0x prefixes, or switch to UTF-16 or code points when you need to match a programming language.

Pasted numbers from a puzzle or a T-shirt? Switch to Numbers → text. The tool guesses whether they are binary, hex or decimal and copes with missing spaces.

Features

  • Four bases, both ways

    Binary, hexadecimal, octal and decimal output, and the same four as input. Auto mode reads only-0-and-1 input as binary, anything with a to f as hex, and the rest as decimal.

  • UTF-8 by default, with other units

    UTF-8 bytes match what web pages and most files store. UTF-16 code units match JavaScript, Java and C# strings. Code points give one number per character, the U+ numbers you see in Unicode charts.

  • Byte table for every character

    Each of the first 200 characters gets a row with its code point, UTF-8 bytes in hex, binary and decimal. It's the quickest way to see where an odd character in your data came from.

  • Separators and prefixes

    Separate values with a space, a comma, a new line, nothing at all, or your own string. Pad with leading zeros, add 0b, 0x or 0o, and choose upper or lower case hex.

  • Tolerant decoding

    Decoding accepts spaces, commas, colons or dashes between values, 0b, 0x, \x, U+ and &# prefixes, and long runs with no spaces, which are cut into 8-bit bytes. Bad groups are named in the error.

  • Every base at once

    While encoding, a strip under the result shows the same text in the other three bases, each with its own copy button.

How to use the text to binary converter

  1. 1Choose Text → numbers or Numbers → text.
  2. 2Pick binary, hex, octal or decimal, the character units and a separator.
  3. 3Copy the result, or check each character's bytes in the table.

When to use it

  • Homework and computing classes

    Type your name and read the 8-bit pattern of each letter. Switch to decimal to see the ASCII codes, then to hex to see how two hex digits make one byte. The number base converter covers single numbers in any base from 2 to 36.

  • Decoding a binary message

    Paste the 0s and 1s, with or without spaces. If the result looks like gibberish, try the other units. Old puzzles sometimes use 7-bit ASCII, which decodes fine when the values are separated.

  • Debugging strings in code

    A user name that won't match, or a CSV with a strange symbol? Paste it and check the byte table. A non-breaking space shows as C2 A0 rather than 20, and a curly apostrophe as E2 80 99.

  • Making a gift or a tattoo design

    Binary initials or a date in binary are popular on rings and bracelets. Check the bytes twice here before anyone engraves them. For encoding data rather than decoration, Base64 is the usual choice.

How do you convert text to binary?

A computer stores each character as a number. The text is first turned into bytes with a character encoding, and each byte is then written in base 2. With UTF-8, the encoding used by almost every web page today, the letters of English text are one byte each and match the old ASCII codes.

Take the word Hi. H is code 72 and i is code 105. In binary, 72 is 01001000 and 105 is 01101001, so Hi becomes 01001000 01101001. In hex the same bytes are 48 69, and in octal 110 151.

  • Find the character's code: H = 72.
  • Write it in base 2: 72 = 64 + 8 = 1001000.
  • Pad to 8 bits: 01001000.
  • Repeat for each byte and join them with spaces.

Why do accents and emoji take more bytes?

UTF-8 (defined in RFC 3629) uses one byte for the 128 ASCII characters, two bytes for most accented Latin letters, Greek, Cyrillic, Hebrew and Arabic, three bytes for most other scripts including Chinese, Hindi and Bengali, and four bytes for emoji and rarer characters.

So é is 11000011 10101001 (C3 A9), and 😀 is F0 9F 98 80. A tool that writes one 8-bit group per character is only right for plain English. For anything else, it gives numbers that won't decode back.

UTF-8, UTF-16 or code points: which should I pick?

Pick UTF-8 bytes unless you know you need something else. It is what files, URLs and network data use.

Pick UTF-16 code units to match what a JavaScript string's charCodeAt returns, or what Java and Windows store in memory. Emoji take two units there, a so-called surrogate pair. Pick code points for the U+ numbers in Unicode charts and HTML entities like 😀. Each character is then a single number, no matter how many bytes it needs.

Why use Mavros

 MavrosTypical upload sites
Emoji and accentsCorrect UTF-8 bytesOften one wrong byte per character
Character unitsUTF-8, UTF-16 or code pointsOne fixed method
Per-character byte tableCode point, hex, binary, decimalRare
Decoding without spacesSplit into bytes, with checksFails or guesses
Invalid UTF-8Warning with a fix to trySilent junk
PrivacyRuns in your browserVaries

Tips

  • 8 bits make a byte, and one hex digit is exactly 4 bits. That is why hex is the usual shorthand for binary.
  • If decoding gives control characters or �, the base or unit is probably wrong. Try Auto, then try Code points.
  • Without separators, binary is split into 8-digit groups. If a digit is missing, the tool tells you rather than shifting every byte.
  • Need percent-encoding for a link instead? Use URL encode and decode. Need a fingerprint of the bytes? Use the hash generator.

Questions

What is the letter A in binary?

Capital A is 01000001, which is decimal 65 or hex 41. Lowercase a is 01100001, decimal 97. Upper and lower case letters differ by exactly 32, one bit.

How many bits are in one character?

In UTF-8, an English letter or digit is 8 bits. Accented letters are 16 bits, most other scripts 24, and emoji 32. Old 7-bit ASCII used 7 bits, which is why some tables show codes without the leading zero.

How do I convert binary back to text?

Choose Numbers → text and paste the binary. Groups of 8 digits, with or without spaces, decode to UTF-8 text straight away. If the digits don't split evenly, the tool says so.

Is binary the same as ASCII?

No. ASCII is a table that gives each character a number, such as 65 for A. Binary is just a way to write that number in base 2. UTF-8 keeps the same numbers for all 128 ASCII characters.

Why does my emoji turn into four groups of binary?

UTF-8 needs four bytes for characters beyond the first 65,536 code points, which includes nearly all emoji. Each byte becomes one 8-bit group. Choose Code points to get a single number instead.

What does 0b or 0x mean in front of a number?

They are prefixes from programming languages. 0b marks binary, 0x marks hexadecimal and 0o marks octal. Tick Add prefix to include them, and decoding strips them for you.

What is hello in binary?

Lowercase hello is 01101000 01100101 01101100 01101100 01101111. In hex that is 68 65 6C 6C 6F, and in decimal 104 101 108 108 111.

Is my text sent anywhere?

No. The conversion runs in your browser with the built-in TextEncoder and TextDecoder. Short text is kept in the page address so you can share a link to the result.