Skip to content

Text to Binary Converter (ASCII to Binary)

Convert text into 8-bit binary code, one byte per character, with a choice of separator.

Runs in your browser Free, no sign-up
Loading tool workspace...

What is ASCII Text to Binary Converter?

This text to binary converter turns English letters, words and sentences into binary code. Every character has a numeric code, and for English letters, digits and punctuation that code fits in one byte: H is 72, which is 01001000, and i is 105, which is 01101001, so "Hi" becomes 01001000 01101001.

Type or paste any text and the binary appears instantly, with each character as an 8-bit group. You can separate the bytes with spaces, commas or new lines, or join them into one continuous string.

How to use ASCII Text to Binary Converter

  1. Type or paste the text you want to convert.
  2. Read the binary code, one 8-bit group per character.
  3. Choose the separator: space, comma, new line or none.
  4. Copy the binary, or click Swap to convert binary back to text.

Key features

  • Converts any text to binary, one byte per character
  • 8-bit groups padded with leading zeros
  • Separator choice: space, comma, new line or none
  • Swap button to decode binary back to text
  • Instant conversion as you type
  • Runs entirely in your browser

Common use cases

  • Teaching how computers store text
  • Creating binary messages for puzzles, games and gifts
  • Generating test data for binary parsers
  • Checking the bit patterns of characters
  • Building capture-the-flag challenges

Technical details & standards

Each character is converted to its code and written in binary, padded to 8 bits: A = 65 = 01000001, a = 97 = 01100001, 0 = 48 = 00110000 and a space = 32 = 00100000. Upper and lower case letters differ by one bit (32).

The code used is the character's UTF-16 code unit, which equals its ASCII code for all ASCII characters. Characters outside ASCII get longer codes: é is 233 (11101001) and € is 8364 (10000010101100), which is not the same as their UTF-8 byte sequence, so use ASCII text for portable results.

How to convert letters to binary code by hand

Each character has a number, and each number has an 8-bit binary form. Here is the word "Go":

  1. Look up each character's code: G is 71 and o is 111.
  2. Write 71 as a sum of powers of two: 64 + 4 + 2 + 1. Put a 1 in those places of 128, 64, 32, 16, 8, 4, 2, 1, and 0 elsewhere: 01000111.
  3. Do the same for 111 = 64 + 32 + 8 + 4 + 2 + 1, which gives 01101111.
  4. Join the bytes with a space so each character stays readable.

Result: "Go" in binary is 01000111 01101111. The table below gives every letter, so for short words you can skip the arithmetic.

Convert words to binary code in Python and JavaScript

Both snippets turn each character into an 8-bit group separated by spaces, like the converter. The second line of each encodes the text as UTF-8 first, which is what you want for accented letters and emoji.

Python

" ".join(format(ord(c), "08b") for c in "Go")          # '01000111 01101111'
" ".join(f"{b:08b}" for b in "café".encode("utf-8"))  # '01100011 01100001 01100110 11000011 10101001'

JavaScript

[..."Go"].map(c => c.charCodeAt(0).toString(2).padStart(8, "0")).join(" ");
// "01000111 01101111"
[...new TextEncoder().encode("café")].map(b => b.toString(2).padStart(8, "0")).join(" ");
// "01100011 01100001 01100110 11000011 10101001"

The alphabet in binary: letters A–Z

The 8-bit binary code of every letter, in capitals and lowercase. The two forms differ only in the third bit from the left (worth 32), which is how text to binary converters and old keyboards switch case.

LetterUppercase binaryLowercase binaryDecimal (upper / lower)
A010000010110000165 / 97
B010000100110001066 / 98
C010000110110001167 / 99
D010001000110010068 / 100
E010001010110010169 / 101
F010001100110011070 / 102
G010001110110011171 / 103
H010010000110100072 / 104
I010010010110100173 / 105
J010010100110101074 / 106
K010010110110101175 / 107
L010011000110110076 / 108
M010011010110110177 / 109
N010011100110111078 / 110
O010011110110111179 / 111
P010100000111000080 / 112
Q010100010111000181 / 113
R010100100111001082 / 114
S010100110111001183 / 115
T010101000111010084 / 116
U010101010111010185 / 117
V010101100111011086 / 118
W010101110111011187 / 119
X010110000111100088 / 120
Y010110010111100189 / 121
Z010110100111101090 / 122

Frequently asked questions

How do I convert letters into binary?

Look up each character's ASCII code and write it as an 8-bit binary number. "Hi": H = 72 = 01001000 and i = 105 = 01101001.

What is "hello" in binary?

01101000 01100101 01101100 01101100 01101111, one byte each for h, e, l, l and o.

What is the letter A in binary?

Uppercase A is 01000001 (65) and lowercase a is 01100001 (97). The only difference is the bit worth 32.

Why are there 8 digits per letter?

Text is stored in bytes of 8 bits. ASCII only needs 7, so the first bit of every ASCII character is 0, but writing full bytes keeps the groups aligned.

How are accented letters such as é converted to binary?

This converter writes each character's code, so é (code 233) becomes the single byte 11101001. Files and web pages usually store é in UTF-8 instead, as the two bytes 11000011 10101001, so use the UTF-8 snippet above when you need the bytes as they are saved.

More converters tools

View all