ASCII Table

Complete ASCII character reference table

Search ASCII Characters
ASCII Character Table
DecHexOctBinaryCharDescription
00x000000000000·Control Character
10x010010000001·Control Character
20x020020000010·Control Character
30x030030000011·Control Character
40x040040000100·Control Character
50x050050000101·Control Character
60x060060000110·Control Character
70x070070000111·Control Character
80x080100001000·Control Character
90x090110001001·Control Character
100x0A0120001010·Control Character
110x0B0130001011·Control Character
120x0C0140001100·Control Character
130x0D0150001101·Control Character
140x0E0160001110·Control Character
150x0F0170001111·Control Character
160x100200010000·Control Character
170x110210010001·Control Character
180x120220010010·Control Character
190x130230010011·Control Character
200x140240010100·Control Character
210x150250010101·Control Character
220x160260010110·Control Character
230x170270010111·Control Character
240x180300011000·Control Character
250x190310011001·Control Character
260x1A0320011010·Control Character
270x1B0330011011·Control Character
280x1C0340011100·Control Character
290x1D0350011101·Control Character
300x1E0360011110·Control Character
310x1F0370011111·Control Character
320x200400100000 Space
330x210410100001!Punctuation
340x220420100010"Punctuation
350x230430100011#Punctuation
360x240440100100$Punctuation
370x250450100101%Punctuation
380x260460100110&Punctuation
390x270470100111'Punctuation
400x280500101000(Punctuation
410x290510101001)Punctuation
420x2A0520101010*Punctuation
430x2B0530101011+Punctuation
440x2C0540101100,Punctuation
450x2D0550101101-Punctuation
460x2E0560101110.Punctuation
470x2F0570101111/Punctuation
480x3006001100000Digit
490x3106101100011Digit
500x3206201100102Digit
510x3306301100113Digit
520x3406401101004Digit
530x3506501101015Digit
540x3606601101106Digit
550x3706701101117Digit
560x3807001110008Digit
570x3907101110019Digit
580x3A0720111010:Symbol
590x3B0730111011;Symbol
600x3C0740111100<Symbol
610x3D0750111101=Symbol
620x3E0760111110>Symbol
630x3F0770111111?Symbol
640x401001000000@Symbol
650x411011000001AUppercase Letter
660x421021000010BUppercase Letter
670x431031000011CUppercase Letter
680x441041000100DUppercase Letter
690x451051000101EUppercase Letter
700x461061000110FUppercase Letter
710x471071000111GUppercase Letter
720x481101001000HUppercase Letter
730x491111001001IUppercase Letter
740x4A1121001010JUppercase Letter
750x4B1131001011KUppercase Letter
760x4C1141001100LUppercase Letter
770x4D1151001101MUppercase Letter
780x4E1161001110NUppercase Letter
790x4F1171001111OUppercase Letter
800x501201010000PUppercase Letter
810x511211010001QUppercase Letter
820x521221010010RUppercase Letter
830x531231010011SUppercase Letter
840x541241010100TUppercase Letter
850x551251010101UUppercase Letter
860x561261010110VUppercase Letter
870x571271010111WUppercase Letter
880x581301011000XUppercase Letter
890x591311011001YUppercase Letter
900x5A1321011010ZUppercase Letter
910x5B1331011011[Symbol
920x5C1341011100\Symbol
930x5D1351011101]Symbol
940x5E1361011110^Symbol
950x5F1371011111_Symbol
960x601401100000`Symbol
970x611411100001aLowercase Letter
980x621421100010bLowercase Letter
990x631431100011cLowercase Letter
1000x641441100100dLowercase Letter
1010x651451100101eLowercase Letter
1020x661461100110fLowercase Letter
1030x671471100111gLowercase Letter
1040x681501101000hLowercase Letter
1050x691511101001iLowercase Letter
1060x6A1521101010jLowercase Letter
1070x6B1531101011kLowercase Letter
1080x6C1541101100lLowercase Letter
1090x6D1551101101mLowercase Letter
1100x6E1561101110nLowercase Letter
1110x6F1571101111oLowercase Letter
1120x701601110000pLowercase Letter
1130x711611110001qLowercase Letter
1140x721621110010rLowercase Letter
1150x731631110011sLowercase Letter
1160x741641110100tLowercase Letter
1170x751651110101uLowercase Letter
1180x761661110110vLowercase Letter
1190x771671110111wLowercase Letter
1200x781701111000xLowercase Letter
1210x791711111001yLowercase Letter
1220x7A1721111010zLowercase Letter
1230x7B1731111011{Symbol
1240x7C1741111100|Symbol
1250x7D1751111101}Symbol
1260x7E1761111110~Symbol
1270x7F1771111111·Delete
ASCII Reference

Control Characters (0-31)

Non-printable characters used for text control

Printable Characters (32-126)

Letters, digits, punctuation, and symbols

Extended ASCII (128-255)

Not shown - varies by character set

Complete ASCII Reference Guide

Everything you need to know about ASCII — from the 7-bit encoding standard that powers the internet to practical programming tricks used every day.

Understanding ASCII

What ASCII Is

  • ASCII (American Standard Code for Information Interchange): developed in 1963 by ANSI
  • 7-bit encoding: 128 characters (0–127)
  • First 32 characters (0–31): control characters (non-printable) — carriage return, line feed, tab, null, etc.
  • Characters 32–126: printable — space, digits, uppercase letters, lowercase letters, punctuation
  • Character 127: DEL (delete control code)
  • Extended ASCII (8-bit / 128–255): varies by code page — Windows-1252, ISO-8859-1, etc.
  • Unicode backward-compatible: all ASCII code points match their Unicode equivalents
  • ASCII is the foundation of virtually all modern text encoding

ASCII vs. Modern Encoding

  • ASCII: 7-bit, 128 characters — English only
  • ISO-8859-1 (Latin-1): 8-bit, 256 characters — Western European languages
  • Windows-1252 (CP1252): 8-bit, 256 characters — similar to Latin-1 with extras
  • UTF-8: variable 1–4 bytes — covers all 1.1 million Unicode code points
  • UTF-8 is ASCII-compatible — single-byte chars 0–127 are identical
  • UTF-16: 2–4 bytes per character — used by Windows internally
  • ASCII art: text-based images using printable characters arranged in patterns
  • ASCII in protocols: HTTP headers, SMTP, FTP, and most internet protocols use ASCII for control sequences

ASCII Reference Charts

Printable ASCII Reference (32–126)

  • 32: Space
  • 33: ! (exclamation)
  • 34: " (double quote)
  • 35: # (hash/pound)
  • 36: $ (dollar)
  • 37: % (percent)
  • 38: & (ampersand)
  • 39: ' (apostrophe)
  • 40: (
  • 41: )
  • 42: * (asterisk)
  • 43: + (plus)
  • 44: , (comma)
  • 45: - (hyphen)
  • 46: . (period)
  • 47: / (forward slash)
  • 48–57: 0–9 (digits)
  • 58: :
  • 59: ;
  • 60: <
  • 61: =
  • 62: >
  • 63: ?
  • 64: @
  • 65–90: A–Z (uppercase)
  • 91: [
  • 92: \ (backslash)
  • 93: ]
  • 94: ^ (caret)
  • 95: _ (underscore)
  • 96: ` (backtick)
  • 97–122: a–z (lowercase)
  • 123: {
  • 124: | (pipe)
  • 125: }
  • 126: ~ (tilde)

Control Characters (0–31 and 127)

  • 0: NUL (null) — string terminator in C
  • 7: BEL (bell) — terminal beep
  • 8: BS (backspace)
  • 9: HT (horizontal tab) — \t in code
  • 10: LF (line feed) — \n — Unix/Linux line ending
  • 13: CR (carriage return) — \r — combined with LF on Windows
  • 26: SUB — Ctrl+Z — EOF marker in Windows
  • 27: ESC (escape) — terminal control sequences start with \033
  • 28–31: FS, GS, RS, US — file/group/record/unit separators (legacy data)
  • 127: DEL (delete) — originally sent to delete a character on paper tape
  • Unix new line: LF (10) only
  • Windows: CRLF (13+10)
  • macOS (classic): CR (13) only
  • macOS (modern): LF (10)

Decimal / Octal / Hex / Binary Reference

  • Digit 0: Dec 48, Oct 060, Hex 0x30, Bin 00110000
  • Digit 9: Dec 57, Oct 071, Hex 0x39, Bin 00111001
  • Letter A: Dec 65, Oct 0101, Hex 0x41, Bin 01000001
  • Letter Z: Dec 90, Oct 0132, Hex 0x5A, Bin 01011010
  • Letter a: Dec 97, Oct 0141, Hex 0x61, Bin 01100001
  • Letter z: Dec 122, Oct 0172, Hex 0x7A, Bin 01111010
  • Space: Dec 32, Oct 040, Hex 0x20, Bin 00100000
  • DEL: Dec 127, Oct 0177, Hex 0x7F, Bin 01111111
  • Uppercase to lowercase: add 32 (or set bit 5: OR 0x20)
  • Lowercase to uppercase: subtract 32 (or clear bit 5: AND ~0x20)

Real-World Applications

Programming & Development

  • String operations: ASCII codes determine sort order — 'A' (65) < 'a' (97) < '{' (123)
  • Character validation: check code range to classify letters (65–90 or 97–122), digits (48–57), whitespace (≤ 32)
  • Input sanitization: reject characters outside printable range (32–126) for plain-text fields
  • C/C++ string.h functions (strlen, strcpy) use null terminator (ASCII 0) to end strings
  • Bitwise tricks: toggle case with XOR 0x20; check digit with code - 48; escape sequences: \n=10, \t=9, \r=13, \0=0
  • File parsing: detect CR/LF vs LF endings by checking for 13 before 10
  • Protocol parsing: HTTP, SMTP, FTP headers are ASCII — parse headers byte-by-byte

Networking & Protocols

  • HTTP: request/response headers are ASCII text; body can be any encoding
  • SMTP email: headers in ASCII; body in UTF-8 with quoted-printable or base64 encoding
  • FTP commands: ASCII control channel (PORT, PASV, LIST are text commands)
  • SSH session negotiation: SSH_MSG codes are ASCII-based negotiation strings
  • Base64: converts binary to printable ASCII (A–Z, a–z, 0–9, +, /) for safe transport in text protocols
  • URL encoding: non-ASCII chars → %XX hex (e.g., space → %20)
  • JSON: must use Unicode escapes for non-ASCII in strict ASCII transport
  • Serial communication: older protocols (Modbus ASCII, NMEA 0183 GPS) use ASCII framing

Data Processing & CSV

  • CSV parsing: delimiter (44=comma), quote (34=double-quote), newline (10=LF) define the format
  • TSV: tab (9=HT) as delimiter — avoids conflicts with commas in data
  • ASCII sort order: numbers before uppercase before lowercase (0–9, A–Z, a–z)
  • String comparison in databases: case-sensitive vs case-insensitive depends on ASCII ordering
  • Regex character classes: [A-Z] uses ASCII ranges 65–90; [0-9] uses 48–57
  • Data validation: enforce plain-ASCII input for passwords, usernames, or codes that must be portable
  • Checksums: simple XOR checksum of ASCII bytes used in NMEA, Modbus, and legacy protocols
  • Configuration files: INI, .env, requirements.txt all use ASCII-safe keys and values

Security & Encoding

  • SQL injection: ASCII knowledge helps understand why '; (39,59) and -- (45,45) are dangerous
  • XSS: characters < (60), > (62), & (38), " (34), ' (39) must be HTML-escaped
  • Command injection: ; (59), | (124), & (38), ` (96), $ (36) are shell metacharacters
  • URL encoding: all non-ASCII (and many ASCII) must be percent-encoded in URLs
  • Base64 encoding: converts binary secrets to printable ASCII for safe storage in env files
  • JWT tokens: header+payload encoded as Base64URL (URL-safe ASCII only)
  • CSV injection: = (61) and @ (64) as first char trigger formula execution in spreadsheets
  • Log injection: newline characters (10, 13) in user input can forge log entries

Best Practices

Working with ASCII in Code

  • Always specify encoding explicitly — don't rely on system defaults (utf-8 in Python, UTF-8 in Java)
  • Use character literals instead of magic numbers: '\n' instead of 10, 'a' instead of 97
  • When comparing characters, be case-aware: 'A' and 'a' differ by exactly 32 in ASCII
  • Null-terminate C strings explicitly — forgetting NUL (0) causes buffer overruns
  • For network protocols, always use ASCII-safe encoding for header values
  • In databases, use UTF-8 column collation — MySQL's utf8 is broken, use utf8mb4
  • Validate character ranges for security-sensitive inputs (usernames, filenames, API keys)
  • When generating random tokens, use only URL-safe ASCII: A–Z, a–z, 0–9, -, _

Encoding Pitfalls to Avoid

  • Don't assume ASCII — modern text is Unicode
  • strlen() in C counts bytes, not characters for multi-byte UTF-8
  • Don't use + for space encoding in URLs unless in query strings — use %20 in paths
  • Don't confuse code pages — Windows-1252 and ISO-8859-1 differ at positions 128–159
  • Avoid assuming line endings — use \n on Unix, normalize CRLF to LF when reading cross-platform files
  • Don't use ASCII art in source code comments if the source file is UTF-8 — use Unicode box-drawing characters instead
  • Base64 padding = chars can confuse URL parsers — use Base64URL for URL embedding
  • Don't truncate UTF-8 strings by byte count — you may split a multi-byte character

Code Examples

Common Character Lookups

  • Check if char is digit: c >= 48 && c <= 57 (or c >= '0' && c <= '9')
  • Check if uppercase: c >= 65 && c <= 90
  • Check if lowercase: c >= 97 && c <= 122
  • Convert digit char to int: c - 48 (e.g., '7' = 55, 55-48 = 7)
  • Toggle case: c ^ 32 (e.g., 'A'=65, 65^32=97='a')
  • Newline detection: c == 10 (LF) or c == 13 (CR)
  • Tab detection: c == 9
  • Printable check: c >= 32 && c <= 126

Protocol ASCII Usage

  • HTTP GET request start: 47 45 54 20 = "GET "
  • HTTP status 200: 50 30 30 = "200"
  • SMTP HELO command: 72,69,76,79,32 = "HELO "
  • Base64 alphabet starts: A=65, B=66 ... Z=90, a=97 ... z=122, 0=48 ... 9=57, +=43, /=47
  • URL space encoding: space(32) → %20
  • URL ampersand: &(38) → %26
  • JSON quote: "(34) → \"
  • CSV comma: ,(44) separates fields; CSV newline: LF(10) separates rows

ASCII Art & Creative Use

  • Box drawing (Extended ASCII): ─│┌┐└┘├┤┬┴┼ — used in terminal UIs
  • Simple box: corners use + (43), sides use - (45) and | (124)
  • Arrow in ASCII: --> (45,45,62) or <-- (60,45,45)
  • Emoji precursor: :-) = 58,45,41; :( = 58,40
  • Progress bar: [####----] using # (35), - (45), [ (91), ] (93)
  • Divider line: =============== using = (61)
  • Terminal colors: \033[31m = ESC + [ + 3 + 1 + m = red text
  • Stars/borders: * (42) rows for attention-grabbing text

Frequently Asked Questions

What is the difference between ASCII and Unicode?
ASCII is a 7-bit encoding with 128 characters covering English letters, digits, and basic punctuation. Unicode is a universal standard covering 1.1 million code points for all the world's writing systems — emoji, Chinese, Arabic, math symbols, and everything else. UTF-8 is the most common Unicode encoding and is backward-compatible with ASCII: the first 128 UTF-8 code points are byte-for-byte identical to ASCII.
Why do uppercase and lowercase letters differ by 32?
ASCII was designed so that case conversion is a single bit flip. Uppercase letters start at 65 (01000001), lowercase at 97 (01100001). The difference is exactly 32, which is the value of bit 5 (0x20). To convert uppercase to lowercase: set bit 5 (OR 0x20). To convert lowercase to uppercase: clear bit 5 (AND ~0x20 or AND 0xDF). This was intentional — it makes case conversion extremely efficient in hardware.
What are CRLF and LF and why do they matter?
Line endings are ASCII control characters: LF (Line Feed, code 10, \n) on Unix/Linux/macOS, and CRLF (Carriage Return + Line Feed, codes 13+10, \r\n) on Windows. This difference causes files created on one OS to display incorrectly on another — a common source of bugs when sharing files or running cross-platform code. Git can normalize line endings with core.autocrlf = true.
Why does the space character have code 32?
ASCII was designed around teletype machines and punched cards. Control codes (0–31) came first for machine control. Printable characters start at 32 because 32 = 00100000 in binary — the first value with bit 5 set. The designers placed space at 32 so it sorts before any printable character, which is useful: ' ' < '0' < 'A' < 'a' in ASCII order.
What is Base64 and how does it relate to ASCII?
Base64 encodes arbitrary binary data as printable ASCII text using only 64 safe characters: A–Z, a–z, 0–9, +, /. This allows binary data (images, files, cryptographic keys) to be safely transmitted in text-only contexts like email, JSON, HTML attributes, and URL query strings. Each 3 bytes of binary data become 4 ASCII characters, making Base64-encoded data about 33% larger than the original.
Can I use ASCII codes in JavaScript?
Yes. String.fromCharCode(65) returns 'A'. 'A'.charCodeAt(0) returns 65. For Unicode beyond ASCII, use String.fromCodePoint(128512) for emoji (😀). charCodeAt() returns the UTF-16 code unit — for characters above U+FFFF (like most emoji), use codePointAt() instead. In template literals, use \u0041 for 'A' or \u{1F600} for 😀.

Need Unit Conversions Too?

Check out our professional unit converter platform:

Visit PrecisionConvert →

Advanced Unit Converter • Scientific Tools • Professional Accuracy

CalculatorTools PRO

Professional calculators and tools for finance, health, math, and everyday calculations.

Get in Touch

We typically respond within 24 hours

For calculator support, bug reports, and feature requests

About CalculatorTools PRO

CalculatorTools PRO is a comprehensive platform offering professional-grade calculators and conversion tools for finance, health, mathematics, and everyday calculations. Our tools are designed with accuracy, ease of use, and professional reliability in mind. Whether you're calculating mortgage payments, BMI, percentages, or converting units, our calculators provide instant, accurate results with detailed explanations. Trusted by professionals, students, and individuals worldwide for critical calculations and conversions.

Disclaimer

The calculators and tools provided on CalculatorTools PRO are for informational and educational purposes only. While we strive for accuracy, results should not be considered as professional financial, medical, or legal advice. For important decisions, please consult with qualified professionals. We are not responsible for any decisions made based on the calculations provided by our tools.

© 2024 CalculatorTools PRO. All rights reserved.