Text to ASCII converter

Type any text and get its ASCII codes: Hello is 72 101 108 108 111. Switch Output to hex, binary or octal, and every space and punctuation mark gets its own code.

ASCII to text

Show each character
0 bytes
Checked byTomeshia Brock
Reviewed byKhushboo Gupta
Last updated · How we test

Runs in your browser. Nothing you type is uploaded.

How to use the converter

  1. Type or paste text in the left box.
  2. Pick Decimal, Hex, Binary or Octal under Output. Decimal is what most people mean by ASCII codes.
  3. Choose a separator under the box: spaces, commas, new lines or none.
  4. Copy, download or share the codes. The ASCII to text tab above the tool turns codes back into words.

How to convert text to ASCII

ASCII numbers 128 characters from 0 to 127: the English letters in both cases, the digits, punctuation, the space and some invisible control codes. To convert text, replace each character with its number, in order, without skipping spaces.

The phrase I love you converted to ASCII codes, one box per character including spaces: 73 32 108 111 118 101 32 121 111 117.

Capital I is 73, the space is 32, l is 108, o is 111, v is 118, e is 101, y is 121 and u is 117. That gives 73 32 108 111 118 101 32 121 111 117 for the three words.

ASCII codes for every letter

LetterCapitalSmall
A6597
B6698
C6799
D68100
E69101
F70102
G71103
H72104
I73105
J74106
K75107
L76108
M77109
N78110
O79111
P80112
Q81113
R82114
S83115
T84116
U85117
V86118
W87119
X88120
Y89121
Z90122

Small letters are always 32 higher than their capital. Digits are just as regular: 0 is 48 and 9 is 57, so the code of a digit is the digit plus 48. The ASCII table has the punctuation and control codes too.

The same text in decimal, hex, binary and octal

The word Code written as ASCII in four number systems: decimal 67 111 100 101, hex 43 6F 64 65, binary 01000011 01101111 01100100 01100101 and octal 103 157 144 145.

ASCII codes are ordinary numbers, so they can be written in any base. Hex is popular in programming because each code is exactly two digits, and binary shows the actual bits stored in memory. For hex output with more style options, use text to hex; for binary, ASCII to binary.

Text to ASCII codes, not ASCII art

Some tools with a similar name draw big banner letters out of characters, which is called ASCII art. This converter does something different: it gives the code number of each character, the way a computer stores it.

Characters that are not ASCII

Accented letters, other alphabets and emoji are outside ASCII. With the default UTF-8 encoding, é comes out as two codes, 195 169, because UTF-8 stores it in two bytes. Choose ISO-8859-1 or Windows-1252 under Encoding to get the single code 233 instead. For a character such as € or an emoji, the Unicode converter shows its code point, U+20AC for the euro sign.

Text to ASCII in Python, JavaScript, Excel and C

  • Python: [ord(ch) for ch in "Hi"] returns [72, 105]. For UTF-8 bytes, use list("héllo".encode()).
  • JavaScript: [..."Hi"].map(ch => ch.charCodeAt(0)) returns [72, 105]. For emoji, MDN's charCodeAt() page explains why you need codePointAt() instead.
  • Excel and Google Sheets: =CODE("A") returns 65.
  • C: printf("%d", 'A'); prints 65, because a char is stored as its code.

Frequently asked questions

What is the ASCII code for a space?

32, or 20 in hex. It counts as a character like any other.

What is the ASCII value of A and a?

Capital A is 65 and small a is 97.

What is "I love you" in ASCII?

73 32 108 111 118 101 32 121 111 117.

How do I find the ASCII value of one character?

Type it in the box above, or look it up in the ASCII table. In code, Python's ord() and JavaScript's charCodeAt() do the same thing.

Why does my text give more numbers than characters?

Some characters are not ASCII, and UTF-8 stores them in two to four bytes. The tool shows a note when that happens.

Is my text sent anywhere?

No. The codes are worked out in your browser.

Scroll to Top