Glossary Data & Encoding

ASCII

ASCII is a 7-bit character encoding that assigns numbers 0 to 127 to English letters, digits, punctuation and control codes.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page

In more detail

Codes 0 to 31 (and 127) are control characters such as newline (10), carriage return (13) and tab (9); 32 to 126 are the printable characters, starting with the space. Upper- and lower-case letters differ by exactly 32, a single bit (0x20), which is why case conversion is so cheap. Every ASCII text is also valid UTF-8, which is why the two coexist so easily.

Why it matters

Anything outside 0–127, such as é, € or an emoji, is not ASCII. Systems that assume ASCII mangle such characters or reject them, and the vague label "extended ASCII" covers several incompatible code pages (Latin-1, Windows-1252...). Line endings are also ASCII control codes: Windows uses CR LF (13 10), Unix and macOS use LF (10).

Example

Hi! is the codes 72, 105, 33, or 48 69 21 in hex. The letter A is 65 (01000001) and a is 97 (01100001); the digit 0 is 48. Convert text to codes with Text to ASCII Converter and back with ASCII to Text Converter.

Common confusion

ASCII has only 128 characters; Unicode is the much larger character set that includes them as its first 128 code points.

AdSense Placeholder
Slot: footer_leaderboard