ASCII Character Table
Complete reference table for all 128 ASCII characters with decimal, binary, and hexadecimal values.
Decimal | Oct | Hex | Binary | Character | Description | HTML |
---|
What is ASCII?
ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numeric values to characters for use in computers and digital systems.
The original ASCII defined 128 characters (0–127) using a 7-bit binary system, covering uppercase letters (A–Z), lowercase letters (a–z), digits (0–9), punctuation, and control characters.
Later, Extended ASCII was introduced, expanding the table to 256 characters (0–255) by using the full 8-bit range. This extension includes additional symbols, graphical characters, and characters for other languages.
Each ASCII character has multiple representations:
- • Decimal (0–255)
- • Hexadecimal (00–FF)
- • Binary (00000000–11111111)
ASCII also forms the foundation of Unicode, with the first 128 Unicode characters identical to the original ASCII set.
More Converters
How to Read an ASCII Table
An ASCII table organizes characters into numeric codes and multiple representations. Understanding its columns makes it easier to locate and use characters in programming, web development, and data processing.
Column Breakdown:
Character Ranges:
The table is sequential, so you can easily find a character by its decimal, hex, octal, or binary value and see its HTML equivalents for web use.
ASCII Character Types
The ASCII table (0–255) is divided into categories, each serving specific purposes in computing and text processing.
1. Control Characters (0–31, 127)
Control characters are non-printable values originally designed for teletype and text formatting. They are still used in programming, networking, and file handling.
Essential Codes:
- NULL (0): String terminator in C/C++
- TAB (9): Horizontal tab
- LF (10): Line Feed (newline in Unix/Linux)
- CR (13): Carriage Return (used with LF in Windows)
- ESC (27): Escape for terminal commands
- DEL (127): Delete
Modern Uses:
- • Text formatting (tabs, newlines)
- • Console/terminal operations
- • Network protocols
- • Escape sequences (\n, \t, \r)
2. Printable Characters (32–126)
These are the visible characters commonly used in documents, code, and data.
Character Ranges:
Applications:
- • Programming syntax
- • Web content & HTML
- • File formats (CSV, JSON, XML)
- • User interface text
3. Extended Characters (128–255)
Extended ASCII adds an extra 128 values, including:
- • Accented characters (é, ñ, ü, å)
- • Currency symbols (£, ¥, ¢)
- • Line-drawing and block graphics
- • Additional punctuation and special symbols
These vary by encoding (e.g., ISO-8859-1, Windows-1252), but are still widely used in legacy systems and text files.
4. Most Important ASCII Codes
Some values appear so frequently in programming that they are worth memorizing:
Printable Characters:
- Space (32): Most common separator
- Digits (48–57): '0'–'9'
- Uppercase (65–90): 'A'–'Z'
- Lowercase (97–122): 'a'–'z'
Control Characters:
- NULL (0): String terminator in C
- TAB (9): Indentation
- LF (10): Line breaks in Unix/Linux
- CR (13): Line breaks in Windows
Symbols:
- ! (33): Exclamation, NOT operator
- " (34): Double quote (string literals)
- & (38): Ampersand, HTML entities
- @ (64): Email addresses
- { (123), } (125): Curly braces (code blocks)
- [ (91), ] (93): Square brackets (arrays)
Programming with ASCII
Working with ASCII characters is fundamental to programming and text processing. The ASCII table provides the reference needed for character manipulation, validation, and conversion operations across different programming languages.
Converting ASCII to Text
Converting ASCII codes to text involves mapping numeric values back to their corresponding characters using the ASCII table. This process is essential in programming and data processing applications.
Manual conversion using the ASCII chart:
- • Locate the decimal value in the ASCII table
- • Find the corresponding character in the Character column
- • Combine multiple characters to form a complete text
Programming examples:
JavaScript:
Python:
The interactive ASCII table above allows you to quickly reference any ASCII code and copy the corresponding character for immediate use in your applications.
Getting ASCII Values in JavaScript
JavaScript provides built-in methods to retrieve ASCII values from characters using the ASCII table mapping. This is essential for character manipulation and text processing applications.
Primary methods:
charCodeAt() method:
codePointAt() method (Unicode-safe):
Practical applications:
- • Input validation (checking if characters are within the ASCII range 0-127)
- • Character-based sorting and comparison operations
- • Text encoding and decoding for data transmission
- • Game development keyboard input handling
Validation example:
Reference the ASCII chart above to verify that returned values match the expected ASCII codes for your characters.
Other Programming Languages
Different programming languages provide various methods to work with ASCII characters from the ASCII table. Here are common approaches across popular languages:
Python:
C/C++:
Java:
Common use cases across languages:
- • Input validation and sanitization
- • Character encoding conversions
- • Text parsing and processing algorithms
- • Data serialization and deserialization
- • Game development character handling
The ASCII table provides the universal reference for these operations, ensuring consistent character handling across different programming environments.
ASCII in Context
Understanding ASCII within the broader context of character encoding helps developers make informed decisions about text processing and data handling in modern applications.
ASCII vs Unicode
Understanding the relationship between ASCII and Unicode is crucial for modern text processing and international applications. While the ASCII table remains foundational, Unicode extends character support globally.
ASCII characteristics:
- Size: 128 characters (0-127)
- Encoding: 7-bit per character
- Coverage: English letters, digits, basic symbols, control characters
- Storage: 1 byte per character (with 8th bit unused)
- Created: 1963 for American computing needs
Unicode characteristics:
- Size: Over 1 million possible characters
- Encoding: Variable-width (UTF-8, UTF-16, UTF-32)
- Coverage: All world languages, symbols, emojis
- Storage: 1-4 bytes per character (UTF-8)
- Created: 1987 for international computing
Key relationship:
- • ASCII forms the foundation of Unicode
- • The first 128 Unicode characters (0-127) are identical to the ASCII table
- • UTF-8 encoding is backward-compatible with ASCII
- • ASCII values remain unchanged in Unicode systems
When to use each:
Practical implications:
- • Pure ASCII text is automatically valid UTF-8
- • ASCII knowledge transfers directly to Unicode development
- • Performance considerations favor ASCII for English-only applications
- • International applications require Unicode for proper character support
The ASCII chart above shows the 128 characters that form Unicode's foundation, making ASCII knowledge essential for understanding modern character encoding.
ASCII Relevance Today
Created in 1963, ASCII remains the foundation of modern computing. Its 128 standardized characters continue to shape text processing, programming, and communication systems.
Current Applications
- Programming: Keywords, operators, and identifiers rely on ASCII characters.
- Web Development: HTML, CSS, JavaScript, and URL structures use ASCII symbols.
- System Administration: Shell scripts, logs, and configuration files depend on ASCII text.
- Data Interchange: CSV, JSON, XML, and core internet protocols are ASCII-based.
- Legacy Systems: Mainframes, embedded devices, and industrial systems still require ASCII.
Why ASCII Endures
- Unicode Foundation: UTF-8 preserves full ASCII compatibility.
- Efficiency: One-byte storage makes ASCII ideal for English text.
- Simplicity & Universality: Minimal overhead, supported by all platforms.
- Performance: Faster string processing and reduced memory usage.
Modern Context
- • The first 128 Unicode characters are identical to the ASCII characters.
- • Programming, system administration, and internet protocols are built on ASCII principles.
- • Educational systems teach ASCII as the starting point for understanding encodings.
Ongoing Importance
ASCII will remain relevant as long as:
- • Programming uses English-based keywords.
- • Legacy systems require backward compatibility.
- • Lightweight, efficient text processing is needed in software and networking.
Questions? Answers!
Can I use ASCII characters in website URLs?
Only letters (A-Z, a-z), digits (0-9), and specific symbols like hyphens (-), periods (.), underscores (_), and tildes (~) are allowed. Special characters must be percent-encoded (space becomes %20).
What happens when I copy non-ASCII text to ASCII-only systems?
Non-ASCII characters become question marks (?), boxes (□), or cause encoding errors. Convert extended characters to ASCII equivalents (é→e) to avoid data loss.
How do I type ASCII control characters?
Use Ctrl combinations:
- • Ctrl+I = TAB (9)
- • Ctrl+J = Line Feed (10)
- • Ctrl+M = Carriage Return (13)
- • Ctrl+[ = ESC (27)
Why do some ASCII tables show 256 characters?
Extended ASCII tables include the original 128 ASCII (0-127) plus 128 additional characters (128-255) for accented letters and symbols. The extensions vary by encoding standard.
What's the difference between ASCII and ANSI?
ANSI typically means Windows-1252 encoding: 128 ASCII characters plus 128 Microsoft extensions. True ASCII only covers the range of 0-127.
Why do uppercase/lowercase letters differ by 32?
Intentional design for efficient case conversion. A=65, a=97 (difference of 32=2^5). You can flip the case by toggling bit 5.
How do I convert ASCII to binary manually?
Divide decimal by 2, note remainders, read bottom-to-top, pad to 8 bits. Example: A (65) → 01000001
How do legacy systems handle Unicode text?
They often display '�' (replacement character), break multi-byte sequences, or interpret UTF-8 bytes as individual ASCII. Always test compatibility.
Do ASCII tables vary between systems?
Core ASCII (0-127) is standardized. Extended ASCII (128-255) varies between code pages (CP437, ISO-8859-1, Windows-1252).
How do I validate ASCII-only files?
Python: Check all bytes ≤ 127
Which ASCII characters should I avoid in filenames?
Avoid: Control characters (0-31), / \ : * ? " < > |, leading/trailing spaces. Use letters, digits, hyphens, and underscores.
What's the smallest ASCII set for programming?
95 printable characters (32-126) plus TAB (9) and newline (10) cover most programming needs.