ASCIIBinary

Bits per character
Codes 0–127

Try

13 characters · 13 bytes · 104 bits

Character breakdown

ASCII codes, 8 bits per character
CharacterDecimalHexBinaryDescription
H724801001000Uppercase letter
e1016501100101Lowercase letter
l1086C01101100Lowercase letter
l1086C01101100Lowercase letter
o1116F01101111Lowercase letter
,442C00101100Comma
Space322000100000Space
A654101000001Uppercase letter
S835301010011Uppercase letter
C674301000011Uppercase letter
I734901001001Uppercase letter
I734901001001Uppercase letter
!332100100001Exclamation mark
Guide

How to convert ASCII to binary

  1. Look up each character's ASCII code. H is 72, i is 105 and ! is 33. The table below lists all 95 printable characters.
  2. Write each code in binary by adding powers of two. 72 is 64 + 8, which is 1001000.
  3. Pad every code to 8 bits with leading zeros and keep them in order: 01001000 01101001 00100001.

Worked example

Converting Hi! to binary, one character at a time:

CharacterASCII code8-bit binary
H7201001000
i10501101001
!3300100001

Hi! → 01001000 01101001 00100001

  • ASCII has 128 codes, so 7 bits are enough. Switch to 7-bit to drop the leading 0 from every character.
  • Upper and lowercase letters differ by 32, a single bit: A is 01000001 and a is 01100001.
  • Accents, emoji and curly quotes aren't ASCII. For those, use the text to binary converter.

Printable ASCII characters in binary

Codes 32–126
CharDecBinary
Space3200100000
!3300100001
"3400100010
#3500100011
$3600100100
%3700100101
&3800100110
'3900100111
(4000101000
)4100101001
*4200101010
+4300101011
,4400101100
-4500101101
.4600101110
/4700101111
04800110000
14900110001
25000110010
35100110011
45200110100
55300110101
65400110110
75500110111
CharDecBinary
85600111000
95700111001
:5800111010
;5900111011
<6000111100
=6100111101
>6200111110
?6300111111
@6401000000
A6501000001
B6601000010
C6701000011
D6801000100
E6901000101
F7001000110
G7101000111
H7201001000
I7301001001
J7401001010
K7501001011
L7601001100
M7701001101
N7801001110
O7901001111
CharDecBinary
P8001010000
Q8101010001
R8201010010
S8301010011
T8401010100
U8501010101
V8601010110
W8701010111
X8801011000
Y8901011001
Z9001011010
[9101011011
\9201011100
]9301011101
^9401011110
_9501011111
`9601100000
a9701100001
b9801100010
c9901100011
d10001100100
e10101100101
f10201100110
g10301100111
CharDecBinary
h10401101000
i10501101001
j10601101010
k10701101011
l10801101100
m10901101101
n11001101110
o11101101111
p11201110000
q11301110001
r11401110010
s11501110011
t11601110100
u11701110101
v11801110110
w11901110111
x12001111000
y12101111001
z12201111010
{12301111011
|12401111100
}12501111101
~12601111110
Learn

How ASCII to binary conversion works

What ASCII is, why it uses 7 bits, and the patterns hidden in its binary codes.

An ASCII to binary converter turns each character of plain ASCII text into its binary code: one 7-bit number per character, usually written as an 8-bit byte. Type in the box above and you'll see the binary for every letter, digit and symbol, along with its decimal and hex code. Below is what ASCII is, how to convert ASCII to binary by hand, and the patterns that make ASCII codes easy to read.

What ASCII is

ASCII, the American Standard Code for Information Interchange, was first published in 1963. It gives each of 128 characters a number from 0 to 127: the uppercase and lowercase English letters, the digits 0 to 9, punctuation and symbols, the space, and 33 control codes. The 95 printable characters run from 32, the space, to 126, the tilde (~). Codes 0 to 31 and 127 are control characters, first used to steer printers and teletypes. Nearly every character encoding in use today, including UTF-8, starts with these same 128 codes.

Why ASCII is 7 bits, and why it's written as 8

128 is 2⁷, so seven bits are exactly enough for every ASCII code, from 0000000 to 1111111. Computers work in 8-bit bytes, though, so each ASCII character is stored in a byte whose first bit is 0. That's why A is usually written 01000001 rather than 1000001. Early systems used the spare eighth bit for parity checks or for extra characters, which led to many incompatible "extended ASCII" code pages. This converter writes 8 bits by default. Choose 7-bit to get the original 7-bit codes.

Converting ASCII to binary by hand

Take the word Hi. First look up each character's code: H is 72 and i is 105. Then write each code as a sum of powers of two. 72 is 64 + 8, so its bits are 1001000. 105 is 64 + 32 + 8 + 1, which gives 1101001. Add a leading 0 to each to make full bytes, and Hi becomes 01001000 01101001. If you'd rather skip the arithmetic, the decimal to binary converter shows the steps for any code, and the table on this page lists all 95 printable characters.

Patterns in ASCII binary

ASCII was laid out so that its binary codes are easy to work with:

  • Letters. Uppercase letters start at 65 (01000001) and lowercase letters at 97 (01100001). The last five bits give the letter's position in the alphabet, so Z ends in 11010, which is 26.
  • Case. Upper and lowercase differ by exactly 32, a single bit. Flipping that bit switches A (01000001) to a (01100001).
  • Digits. The digits 0 to 9 are codes 48 to 57, which is 0011 followed by the digit's own 4-bit value, so 7 is 00110111.
  • Space and punctuation. The space is 32, or 00100000, and the first block of punctuation, from ! to /, follows at 33 to 47.

Control characters in binary

The control codes don't print anything, but a few of them are everywhere:

CodeBinaryShort nameMeaning
000000000NULNull
700000111BELBell
800001000BSBackspace
900001001HTHorizontal tab
1000001010LFLine feed
1300001101CRCarriage return
2700011011ESCEscape
12701111111DELDelete

Line endings are the ones you'll meet most. Linux and macOS end lines with a line feed, while Windows uses a carriage return followed by a line feed, 00001101 00001010. When you press Enter in the box above, the browser adds a line feed.

ASCII, UTF-8 and characters that don't fit

ASCII only has room for English letters. Accented letters, other alphabets, emoji, and even the curly quotes and long dashes that word processors insert are outside its 128 codes. UTF-8 solves this while staying compatible: every ASCII character keeps its single-byte code, and other characters use 2 to 4 bytes. That means Hello gives exactly the same binary in ASCII and in UTF-8. If your text contains é or 👋, this ASCII to binary converter points out the first character that doesn't fit, and the text to binary converter will encode it as UTF-8 instead.

Handy tips for ASCII text

  • Pasting text from a document? Replace curly quotes (“ ”) and dashes (–) with straight quotes and hyphens first.
  • Choose No separator for one continuous string of bits, or One per line for a list.
  • To decode binary back into text, use the binary to ASCII converter.
  • Need each character in hex instead? The hex converter turns text into hex bytes, and the ASCII table lists every code.

Remember three prefixes and you can read most ASCII binary at a glance: uppercase letters start with 010, lowercase letters with 011, and digits with 0011.

FAQ

Frequently asked questions

Quick answers about the ascii to binary converter and how it works.

How do I convert ASCII to binary?

Find each character's ASCII code, then write the code as an 8-bit binary number. H is 72, which is 01001000, so Hi becomes 01001000 01101001. Type any text above and the converter does every character for you.

What is the letter A in binary?

Uppercase A is ASCII 65, or 01000001. Lowercase a is 97, or 01100001. The two differ in a single bit, worth 32, and the same is true for every letter of the alphabet.

Is ASCII 7-bit or 8-bit?

ASCII defines 128 codes, so 7 bits are enough. Computers store each character in an 8-bit byte, so ASCII is usually written with a leading 0. Choose 7-bit to drop it: A becomes 1000001.

Why do some characters give an error?

Only the 128 ASCII characters can be converted. Accented letters like é, emoji, and the curly quotes word processors insert (“ ”) are all outside ASCII. The text to binary converter handles them by encoding the text as UTF-8.

What's the binary code for a space or a new line?

A space is ASCII 32, or 00100000. A new line (line feed) is 10, or 00001010, and a tab is 9, or 00001001. Windows files end each line with a carriage return and a line feed: 00001101 00001010.

What's the difference between ASCII and UTF-8?

UTF-8 is built on ASCII: its first 128 characters are the same, with the same single-byte codes. Characters beyond ASCII take 2 to 4 bytes in UTF-8. So for plain English text, ASCII to binary and UTF-8 text to binary give exactly the same bits.

Still have a question?Contact us