Text to ASCII Code Converter
This converter works on code values, one at a time, from the table. Codes run from 0 to 127; anything above that is reported as out of range. For whole text rather than single codes, use Text to Binary; for code values above 127, use Text to Decimal.
Going the other way? Convert ASCII code back to text →
How do you convert text to ASCII code?
Text to ASCII code conversion replaces each character with its row number in the 0–127 ASCII table, so A becomes 65 and a space becomes 32.
The letter A is ASCII code 65. Find each character in the 0–127 ASCII table and write its code, one per character with spaces between; a is 97, the space is 32, and é has no ASCII code.
- Take the first character and find its code in the table: A is 65.
- Write the code as a plain decimal number, with no leading zeros.
- Repeat for every character, spaces included, and separate the codes with a single space: A = 65.
Text to ASCII writes each character as its code, A as 65; the binary and text converters write that same code in binary, hex or octal.
Text to ASCII Code Conversion Table
The codes this page works through, each with the character it stands for and the same value in hex, octal and binary. Find the code in the first column and read across; the row is the whole conversion. Codes 0 to 31 and 127 have no glyph, so the Char column shows their short name instead. This page writes one unpadded decimal ASCII code (0–127) per character; non-ASCII flagged 'not ASCII'. This page shows the rows you need; ASCII code chart (decimal, hex, octal, binary) carries all 128.
| Dec | Char | Hex | Oct | Bin |
|---|---|---|---|---|
| 32 | (space) | 20 | 040 | 00100000 |
| 65 | A | 41 | 101 | 01000001 |
| 73 | I | 49 | 111 | 01001001 |
| 97 | a | 61 | 141 | 01100001 |
| 98 | b | 62 | 142 | 01100010 |
| 100 | d | 64 | 144 | 01100100 |
| 101 | e | 65 | 145 | 01100101 |
| 102 | f | 66 | 146 | 01100110 |
| 103 | g | 67 | 147 | 01100111 |
| 106 | j | 6A | 152 | 01101010 |
| 108 | l | 6C | 154 | 01101100 |
| 110 | n | 6E | 156 | 01101110 |
| 111 | o | 6F | 157 | 01101111 |
| 114 | r | 72 | 162 | 01110010 |
| 116 | t | 74 | 164 | 01110100 |
| 117 | u | 75 | 165 | 01110101 |
| 118 | v | 76 | 166 | 01110110 |
| 121 | y | 79 | 171 | 01111001 |
Worked Example: A to ASCII Code
One code value, taken from the table and written out in full. This is the same working the converter shows when you turn on "show steps".
Result: A = 65
Take the first character, A. Its row in the ASCII table is 65. Decimal codes are written as they are, with no padding: 65.
The codes are joined in the order the characters were typed, one space apart. A character with no row, such as é, is named in the error line rather than guessed at.
Check it in reverse
Read it back and you arrive where you started: code 65 is the letter A. The table is a two-way lookup, not a calculation, so no rounding or padding can change the answer. To verify the result by hand, convert the ASCII codes back to characters and compare it with the value you started from.
Worked examples: text to ASCII code
Each example gives the value first, then the working. Click a value to load it in the converter.
What is I love you in ASCII code?
Text I love you is 73 32 108 111 118 101 32 121 111 117 in ASCII code.
Method: one code per character, spaces included (a space is 32).
What is a in ASCII code?
Text a is 97 in ASCII code.
Method: a is code 97 in the table.
What is A in ASCII code?
Text A is 65 in ASCII code.
Method: A is code 65 in the table.
What is e in ASCII code?
Text e is 101 in ASCII code.
Method: e is code 101 in the table.
What is b in ASCII code?
Text b is 98 in ASCII code.
Method: b is code 98 in the table.
What is d in ASCII code?
Text d is 100 in ASCII code.
Method: d is code 100 in the table.
What is f in ASCII code?
Text f is 102 in ASCII code.
Method: f is code 102 in the table.
What is t in ASCII code?
Text t is 116 in ASCII code.
Method: t is code 116 in the table.
What is g in ASCII code?
Text g is 103 in ASCII code.
Method: g is code 103 in the table.
What is j in ASCII code?
Text j is 106 in ASCII code.
Method: j is code 106 in the table.
What is n in ASCII code?
Text n is 110 in ASCII code.
Method: n is code 110 in the table.
What is r in ASCII code?
Text r is 114 in ASCII code.
Method: r is code 114 in the table.
Common phrases people convert: load one of these into the decoder
Every example above reverses exactly — read the same codes back as characters.
What Changes the Code Output?
Values above 127
A value above 127 is out of range and the converter says so rather than guessing. Codes 128–255 belong to extended sets such as Latin-1, not to ASCII, so there is no single right character for them. Every code that is in range is listed in the ASCII table this converter reads from.
Which base the code is written in
The same code can be typed as decimal, hex, octal or binary, and the base selector says which one you mean. 65, 41, 101 and 01000001 are all the letter A. Pick the wrong base and you look up a different row.
Control codes and printable codes
Codes 32 to 126 are printable characters; 0–31 and 127 are control codes. A control code has no glyph, so the table shows its short name instead — 10 is LF, 13 is CR. Converting one is valid; displaying one is not.
One code or a list
Several codes separated by spaces, commas or new lines convert as a list, in order, and each keeps its own row. The separator is a display choice and does not change any value.
Text to ASCII Code in Code
The same rule in one line. Both take a string and return one decimal code per character.
Python: ' '.join(str(b) for b in s.encode('ascii')) JavaScript: [...new TextEncoder().encode(s)].join(' ') Common Mistakes
- Typing a code instead of text. Here 72 is read as the characters 7 and 2, codes 55 and 50, not as code 72. To turn a whole message into bits instead, use a binary translator for words and names.
- Reading a code in the wrong base. 41 is A in hex and ) in decimal.
- Expecting a character above 127. That value is outside ASCII and the answer depends on which extended set is meant.
- Joining decimal codes with no separator. 72105 is one number, not 72 and 105, because decimal codes have no fixed width.
Frequently Asked Questions
What are the ASCII codes for A to Z and a to z?
A to Z are 65 to 90; a to z are 97 to 122. A is ASCII 65 = 0x41 = 0o101 = 0b01000001; a is 97 = 0x61 = 0o141 = 0b01100001. Uppercase and lowercase differ by 32, which is bit 5.
Is text to ASCII the same as ASCII art?
No. This page gives the code value for each character — A is 65. ASCII art draws pictures out of ASCII characters, which is a different thing entirely.
What happens to characters that are not in ASCII, like é?
The converter flags them rather than guessing. é is code point 233, past the end of the table. Codes 128–255 are not part of ASCII. They belong to extended sets such as Latin-1 (ISO 8859-1), where 255 is ÿ; in pure ASCII a value above 127 is out of range.
How do you convert text to ASCII in Python?
ord('A') gives 65 for one character; [ord(c) for c in s] gives the whole list. ASCII defines 128 characters, codes 0–127, using 7 bits; in practice each code is stored in one 8-bit byte with a leading 0.
Every code here reverses: the same value converts straight back in the ASCII code to character direction.
Related Conversions
The rest of the family sits on the whole binary and text converter set.