The Quick Answer
ASCII assigns a unique number (0–127) to each character. Uppercase A is 65, lowercase a is 97, the digit 0 is 48, and the space character is 32.
To convert text to ASCII decimal: replace each character with its code number. To convert ASCII back to text: look up each number and output the matching character.
| Character | ASCII Decimal | Description |
|---|---|---|
| A | 65 | Uppercase letters start at 65 |
| Z | 90 | Uppercase letters end at 90 |
| a | 97 | Lowercase letters start at 97 |
| z | 122 | Lowercase letters end at 122 |
| 0 | 48 | Digit characters start at 48 |
| 9 | 57 | Digit characters end at 57 |
| (space) | 32 | First printable character |
Example: "Hello" → 72 101 108 108 111
Use our ASCII Decimal Converter to convert any text instantly, or browse the full ASCII Table for quick lookups.
What Is ASCII?
ASCII stands for American Standard Code for Information Interchange. Published in 1963, it defines how 128 characters map to the numbers 0 through 127. Every letter, digit, and punctuation mark you type on a standard keyboard has an ASCII code.
ASCII was designed to solve a practical problem: different computer manufacturers used different codes for the same characters, making data exchange difficult. ASCII created a shared standard.
The Three Regions of the ASCII Table
The 128 codes divide into three groups:
Control characters (0–31 and 127): Non-printable codes that control devices. The most commonly encountered ones are:
| Code | Name | What It Does |
|---|---|---|
| 0 | NUL | Null (string terminator in C) |
| 9 | TAB | Horizontal tab |
| 10 | LF | Line feed (newline on Unix/macOS/Linux) |
| 13 | CR | Carriage return (used with LF on Windows: CR+LF) |
| 27 | ESC | Escape (starts terminal control sequences) |
| 127 | DEL | Delete |
Space (32): The boundary between control and printable characters. It is technically the first printable character.
Printable characters (33–126): Everything you can see — letters, digits, punctuation, and symbols like @, #, $, {, }.
How ASCII Decimal Conversion Works
Converting text to ASCII decimal codes is straightforward: replace each character with the number assigned to it.
Step-by-Step Example
Convert the word "Code" to ASCII decimal:
- C → look up in ASCII table → 67
- o → 111
- d → 100
- e → 101
Result: 67 111 100 101
To reverse it, take each number and find the matching character:
- 67 → C
- 111 → o
- 100 → d
- 101 → e
Result: "Code"
Practical Patterns to Remember
You do not need to memorize the full table. A few anchor points let you calculate most codes:
- Uppercase A = 65. So B = 66, C = 67, … Z = 90.
- Lowercase a = 97. So b = 98, c = 99, … z = 122.
- Digit 0 = 48. So 1 = 49, 2 = 50, … 9 = 57.
- The difference between uppercase and lowercase is always 32. A (65) + 32 = a (97). This is not a coincidence — it was designed so that flipping one bit converts case.
That last point is genuinely useful: in binary, the only difference between A (01000001) and a (01100001) is bit 5. This made case-insensitive comparison very efficient on early hardware.
ASCII vs Unicode
ASCII covers 128 characters. That is enough for English but not for much else. Unicode was created to represent every writing system in the world.
| Feature | ASCII | Unicode |
|---|---|---|
| Characters | 128 | 149,000+ |
| Code range | 0–127 | 0–1,114,111 |
| Languages | English only | Nearly all |
| Emoji | No | Yes |
| Byte size | 1 byte per character | 1–4 bytes (UTF-8) |
| Backward compatible | — | Yes (first 128 codes = ASCII) |
Key point: ASCII is a subset of Unicode. Any valid ASCII text is also valid UTF-8. This is why ASCII remains relevant — it is embedded in the foundation of Unicode.
When ASCII Is Enough
- Configuration files with only English text
- Programming variable names and syntax
- Network protocol headers (HTTP, SMTP)
- Simple data exchange where all parties agree on English-only content
When You Need Unicode
- Text in any non-English language
- Emoji or special symbols
- User-facing content in international applications
- Modern web pages (UTF-8 is the default encoding for HTML5)
Common ASCII Ranges at a Glance
| Range | Characters | Count |
|---|---|---|
| 0–31 | Control characters | 32 |
| 32 | Space | 1 |
| 33–47 | Punctuation: ! " # $ % & ' ( ) * + , - . / |
15 |
| 48–57 | Digits: 0–9 | 10 |
| 58–64 | Punctuation: : ; < = > ? @ |
7 |
| 65–90 | Uppercase letters: A–Z | 26 |
| 91–96 | Symbols: [ \ ] ^ _ ` |
6 |
| 97–122 | Lowercase letters: a–z | 26 |
| 123–126 | Symbols: { | } ~ |
4 |
| 127 | DEL (control character) | 1 |
Common Mistakes When Working with ASCII
Confusing character codes with the characters themselves
The digit "5" is not ASCII code 5. The character "5" has ASCII code 53. Code 5 is a control character called ENQ (enquiry). This trips up beginners regularly.
Assuming all text is ASCII
If your input contains accented characters (é, ñ, ü), emoji, or characters from non-Latin scripts, those fall outside the 0–127 ASCII range. Trying to process them as ASCII will produce errors or garbled output. Use Unicode-aware tools for international text.
Forgetting that newlines are characters too
A line break is not "nothing" — it is a character with a code. On Unix/Linux/macOS, a newline is LF (code 10). On Windows, it is CR+LF (codes 13 and 10). When converting text to ASCII codes, these show up in the output.
Mixing up ASCII and Extended ASCII
"Extended ASCII" (codes 128–255) is not a single standard. Different systems (Latin-1, Windows-1252, ISO 8859) assign different characters to codes above 127. When someone says "extended ASCII," always ask which encoding they mean.
Where ASCII Shows Up in Real Life
Programming: Character comparisons, input validation, and encoding functions all use ASCII values. Checking if a character is a letter often means testing whether its code falls between 65–90 or 97–122.
Networking: HTTP headers, email protocols (SMTP), and URLs are defined in terms of ASCII characters. Non-ASCII characters in URLs must be percent-encoded.
Data formats: CSV, JSON, and XML use ASCII for their structural syntax (commas, brackets, angle brackets). The content inside may be Unicode, but the format itself is ASCII-based.
Debugging: When you see unexpected characters in a file or network stream, converting to ASCII decimal codes helps identify invisible control characters like null bytes, carriage returns, or escape sequences.
Puzzles and CTFs: Capture-the-flag competitions and coding puzzles frequently encode messages as sequences of ASCII decimal numbers.
FAQ
What does ASCII stand for?
ASCII stands for American Standard Code for Information Interchange. It was developed by the American Standards Association (now ANSI) and first published in 1963.
How many characters does ASCII have?
ASCII defines exactly 128 characters, using codes 0 through 127. Of these, 95 are printable (including space) and 33 are control characters.
What is the ASCII code for the letter A?
Uppercase A is 65. Lowercase a is 97. The difference between any uppercase letter and its lowercase equivalent is always 32.
What is ASCII code 0?
Code 0 is the NUL (null) character. In the C programming language, it marks the end of a string. It is a control character and has no visible representation.
Is ASCII the same as UTF-8?
No, but they are compatible. UTF-8 is a variable-length encoding for Unicode that uses 1 to 4 bytes per character. For characters in the ASCII range (0–127), UTF-8 uses exactly the same single-byte encoding as ASCII. So any ASCII file is also a valid UTF-8 file.
Why does lowercase 'a' start at 97 instead of right after 'Z' (90)?
The gap between Z (90) and a (97) contains six punctuation characters: [ \ ] ^ _ and `. The designers placed lowercase letters at 97 so that the difference from uppercase (32) corresponds to exactly one bit flip in binary — making case conversion trivially fast in hardware.
Can I use ASCII codes in HTML?
Yes. HTML supports ASCII characters as decimal character references: A renders as A, & renders as &. This is useful for characters that have special meaning in HTML, like <, >, and &.
What is the ASCII code for a newline?
The line feed character (LF) is code 10. On Windows, a newline is typically a two-character sequence: carriage return (13) followed by line feed (10), written as CR+LF.
How do I find the ASCII code of a character in Python?
Use the built-in ord() function: ord('A') returns 65. To go the other direction, use chr(): chr(65) returns 'A'.
How do I find the ASCII code of a character in JavaScript?
Use 'A'.charCodeAt(0) to get 65. To convert back, use String.fromCharCode(65) to get 'A'. For characters outside the basic ASCII range, use codePointAt() and String.fromCodePoint().
Try It
Convert any text to ASCII decimal codes instantly with our ASCII Decimal Converter, or browse every code in the ASCII Table.
For other encoding conversions, see our Text to Binary Converter, Hex to Text Decoder, and Unicode Codepoint Decoder.