ASCII Explained — Character Encoding for Programmers
Complete guide to ASCII character codes: decimal, hex, binary values, control characters, extended ASCII, and Unicode relationship.
What is ASCII?
ASCII (American Standard Code for Information Interchange) maps 128 characters (codes 0–127) to 7-bit values. It includes uppercase and lowercase English letters, digits, punctuation, space, and 33 control codes (newline, tab, etc.). ASCII became the foundation for text representation in early computing and persists as a subset of modern Unicode.
Key ASCII Values to Memorise
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| Space | 32 | 20 | 00100000 |
| 0 | 48 | 30 | 00110000 |
| A | 65 | 41 | 01000001 |
| a | 97 | 61 | 01100001 |
Lowercase = uppercase + 32. Digits 0–9 start at 48, not 0.
Control Characters
- NUL (0): Null terminator in C strings
- LF (10): Line feed (Unix newline)
- CR (13): Carriage return
- TAB (9): Horizontal tab
Extended ASCII (128–255)
Codes 128–255 depend on code page (Windows-1252, ISO-8859-1). Not portable — modern apps prefer UTF-8 Unicode.
ASCII vs Unicode
Unicode assigns a code point to every character worldwide. UTF-8 encodes Unicode compatibly: ASCII characters (0–127) use one byte identical to ASCII. Non-English characters use multi-byte sequences.
Encoding Text in Practice
When you type “Hi” in Python ord('H') returns 72. Serial protocols often send raw ASCII bytes. Hex dumps show ASCII as both hex values and printable characters.
Tools & Reference
- ASCII Converter — encode/decode strings
- ASCII Table — full printable character listing
- Number System Converter — convert code values between bases
Frequently Asked Questions
What is the ASCII code for @?
64 decimal, 0x40 hex.
Why does ‘A’ + 32 equal ‘a’ in some languages?
Case conversion exploits the fixed 32-offset between uppercase and lowercase ASCII blocks.
Is ASCII the same as UTF-8 for English text?
For characters U+0000 to U+007F, yes — UTF-8 is identical to ASCII.
What is EBCDIC?
An alternative encoding used on IBM mainframes — not compatible with ASCII.
How do I convert a string to hex?
Use our ASCII Converter — it outputs hex byte pairs for each character.
Share this article
Learn Faster with Numverto
Explore free number system converters, binary tools, EMI calculators, GST calculators, and educational guides.
About Numverto
Numverto Editorial Team
Numverto publishes educational content about number systems, computer science concepts, binary arithmetic, financial calculations, EMI formulas, GST calculations, and practical learning resources for students and professionals.
Article Metadata
Tags: ascii, encoding, programming
Last Updated: March 2026
Related Calculators
Related Articles
16 June 2026
ASCII Table — Complete Character Code Reference
Complete ASCII table with decimal, hexadecimal, and binary codes for all 128 characters. Includes printable characters, control codes, and practical usage examples.
Read article →5 May 2026
Computer Number Systems — Binary, Octal, Decimal & Hex
How computers represent numbers: bases used in programming, memory, and networking. Conversion methods and free tools.
Read article →18 June 2026
Octal to Decimal Conversion — Step by Step with Examples
Learn how to convert octal (base 8) numbers to decimal (base 10) using the positional weight method. Includes worked examples, practice problems, and a free converter tool.
Read article →