Text to Binary Converter (ASCII and UTF-8)
Part of Text tools: See all Text tools.
What is Ascii Binary?
A text to binary converter that works as you type. Type Hello and get 01001000 01100101 01101100 01101100 01101111, or paste binary, hex, decimal or octal and read it back as text. It writes the real bytes of UTF-8 (so é is two bytes and an emoji is four), can check text against strict 7-bit ASCII, supports UTF-16BE, and shows a table with the code point and bytes of every character. It runs in your browser.
How to use Ascii Binary
- Type text, or paste binary, hex, decimal or octal, in the top box. With Direction on Auto-detect, a run of 0s and 1s is read as binary and anything else is encoded.
- Choose the Code (binary, hexadecimal, decimal or octal) and the Character encoding (UTF-8, ASCII only, or UTF-16BE).
- Pick a separator (space, none, comma or new line), and optionally add 0b/0x/0o prefixes, uppercase hex or 7-bit binary.
- Read the result and the summary of characters and bytes. The character table shows which bytes belong to which character.
- Copy the result, download it as a .txt file, or press Swap to decode it again and check the round trip.
Why use this tool?
Simple converters often write each character's code number in binary, which is wrong for accented letters and emoji and silently pads broken input. This one writes the bytes that are actually stored, refuses input that is not a whole number of bytes, tells you which characters are not ASCII, and names invisible characters, so the answer is right for homework, debugging and puzzles alike.
FAQ
- How do I convert text to binary?
- Type the text in the box. Each character is turned into its byte value and written as 8 binary digits, so H (72) is 01001000 and i (105) is 01101001. Characters outside ASCII take more than one byte in UTF-8.
- How do I convert binary to text?
- Paste the binary. Spaces between bytes are easiest, but one long string works if its length is a multiple of 8 (or of 7 for 7-bit ASCII). Each byte is turned back into a character, and the tool warns you if the bytes are not valid text.
- What is the difference between ASCII and UTF-8 binary?
- For plain English letters, digits and punctuation there is no difference: both use one byte with the same value. ASCII stops at code 127, while UTF-8 also covers every other character using 2 to 4 bytes, for example é is 11000011 10101001.
- Why is my binary 7 bits instead of 8?
- ASCII codes fit in 7 bits, so some textbooks drop the leading 0. Choose 7 bits under Binary width to write it that way. Computers store each character in a full 8-bit byte, which is the default here.
- Can it convert hex or decimal ASCII codes to text?
- Yes. Set Code to Hexadecimal or Decimal. Hex can be written as 48 65, 4865, 0x48 or %48; decimal values need spaces or commas between them, such as 72 101 108 108 111.
- Is binary code a way to encrypt a message?
- No. Binary, hex and decimal are just other ways of writing the same bytes, and anyone can decode them in seconds. Do not use them to protect passwords or private information.
- Is my text uploaded anywhere?
- No. The conversion runs in your browser. Nothing you type is sent to our server or stored.
What this text to binary converter does
Type a word such as Hello and you see it as binary straight away: 01001000 01100101 01101100 01101100 01101111. There is no Convert button; the result changes on every keystroke. Paste binary instead and the tool reads it back as text. The same box also handles hexadecimal, decimal byte values and octal, so "48 65 6C 6C 6F" and "72 101 108 108 111" both turn back into Hello.
Under the result a character table lists every character you typed or decoded, with its Unicode code point, its decimal value and the exact bytes it takes up in hex and in binary. Invisible characters such as tabs, line breaks and NUL bytes are named in the table so you can see them. A second table, closed by default, lists all 128 ASCII codes in decimal, hex and binary for quick reference.
How to use it
Type or paste into the top box. Leave Direction on Auto-detect and the tool decides for you: input made only of 0s and 1s (at least eight of them) is read as binary, and anything else is treated as text to encode. If Auto-detect guesses wrong, for example when you really want the binary for the characters "0" and "1", set Direction to Text to code or Code to text and it will do exactly that.
Pick the Code you want: binary, hexadecimal, decimal or octal. Pick the Character encoding: UTF-8 for any text, ASCII if you need to make sure the text uses only the 128 basic codes, or UTF-16BE if you are working with Windows or Java strings. Separator controls what goes between bytes: a space is easiest to read, None gives one unbroken string, Comma suits code, and New line puts one byte per line. You can add the 0b, 0x or 0o prefix used in programming languages, switch hex to capitals, and choose 7-bit binary if your textbook or exercise writes ASCII with seven bits.
Copy puts the result on your clipboard, Download saves it as a .txt file, and Swap moves the result back into the input and flips the direction, which is a quick way to check that a round trip gives you the same text.
How text becomes binary
Computers store text as numbers. A character set gives every character a number, and an encoding decides how that number is written as bytes. In ASCII, capital A is 65, lowercase a is 97, the digit 0 is 48 and a space is 32. Written in binary, 65 is 1000001, which is padded to a full byte as 01000001. So "Hi" is the two bytes 72 and 105, or 01001000 01101001 in binary and 48 69 in hex.
Two patterns are handy to remember. Capital and lowercase letters differ by exactly one bit, the 32s bit, so A is 01000001 and a is 01100001. And the digits 0 to 9 are 00110000 to 00111001, so the last four bits of a digit's code are the digit itself.
ASCII and UTF-8: why some characters take more than one byte
ASCII only has 128 codes, 0 to 127. It covers the English alphabet, digits, punctuation and some control codes, but not é, ñ, ü, the euro sign, Chinese or Hindi script, or emoji. If you choose ASCII and type one of these, the tool tells you which characters are outside ASCII instead of quietly producing wrong output.
UTF-8 is the encoding used by most of the web today. It keeps every ASCII character as the same single byte, so plain English text gives identical binary in ASCII and UTF-8. Other characters take two, three or four bytes. The letter é is two bytes (C3 A9), the euro sign € is three (E2 82 AC) and an emoji such as 😀 is four (F0 9F 98 80). That is why the summary line can say, for example, 6 characters = 9 bytes. Many simpler converters take each character's code and write it in binary directly, which gives a long 16-bit number for é and is not how the text is actually stored; this tool writes the real UTF-8 bytes, and the character table shows which bytes belong to which character.
UTF-16BE stores most characters in one 16-bit unit and emoji and other rare characters as a pair of units called a surrogate pair. The tool shows one group per 16-bit unit, so A is 0041 in hex and 😀 is D83D DE00.
Reading binary back into text
Binary is easiest to decode when each byte is separated by a space, but the tool also accepts one long string of 0s and 1s and cuts it into 8-bit bytes. If the number of bits is not a multiple of eight, it does not guess; it tells you how many bits it found, because a missing or extra digit is the most common mistake when binary is typed by hand. A long string whose length divides by seven but not eight is read as 7-bit ASCII, and choosing 7 bits under Binary width makes it prefer seven when both would fit.
Hex input can be written as 48 65, 4865, 0x48 0x65, \x48\x65 or the %48%65 form seen in URLs. Decimal and octal values need a space or comma between them, because without one there is no way to tell where one number ends. When the bytes are not valid UTF-8, the result shows the replacement character � where the bad bytes were and a note explains why. This usually means the data was saved in another encoding or a byte was lost when copying.
Hex, decimal and octal
Binary is the most literal view, but it is long: eight characters per byte. Hexadecimal packs a byte into two characters, which is why programmers, network tools and hex editors use it. Decimal byte values are what you get from functions such as ord() in Python or charCodeAt() in JavaScript for ASCII text, and they are common in school exercises. Octal is rarer today but still appears in older Unix tools and some escape sequences.
Where people use it
Computer science students use a text to binary converter to check homework on character encoding and to see the patterns in the ASCII table. Teachers use it to make puzzles and worksheets. Developers use the hex view and the character table to find hidden characters, such as a non-breaking space or a zero-width character, that break a script or a CSV import, or to see why a string is longer in bytes than in characters. Escape room and puzzle designers use binary messages as clues, and people who receive a binary message in a game, a card or a social post use the decoder to read it.
What it does not do
Writing text as binary is an encoding, not encryption. Anyone can turn it back, so do not use it to hide passwords or private messages. This tool converts text, not files; to turn an image or a PDF into text for embedding, use Base64. It also does not convert a number such as 2026 into base 2. Typing 2026 here gives the binary of the four characters 2, 0, 2 and 6, which is what a text converter should do; to change the number itself to binary, use the number base converter. Very large inputs are capped at 200,000 characters so the page stays responsive, and the character table shows the first 500 characters.
Privacy
Everything happens in your browser with standard JavaScript text encoding. The text and codes you enter are not uploaded, logged or stored, and you do not need an account.
Related tools
To change a number between binary, decimal, hex and octal, use the number base converter. To encode text or files as Base64, use the Base64 encoder and decoder, and for percent-encoding in links, the URL encoder. To get a fingerprint of some text, try the hash generator, and to count characters and words, the word counter.
Also try
Related tools that work well with this one: