keepcalculator

06 Numbers and Powers

ASCII: Meaning, Character Codes, and How It Works

Card No. 06·58513 · Updated · Standard formula, shown below

ASCII stands for American Standard Code for Information Interchange. It is a character-encoding standard that assigns numeric codes to English letters, digits, punctuation, and control instructions, with 128 original codes numbered 0 through 127.

What ASCII is used for

Computers store and transmit information as bits, not as printed letters. An encoding defines how a sequence of bits corresponds to text or another symbol. ASCII supplies a shared mapping for basic English text: for example, the capital letter A is code 65, the digit 0 is code 48, and a space is code 32.

ASCII’s influence is especially visible in computing systems that exchange text, display terminal output, or process programming-language syntax. Its compact, consistent set of characters made it useful when computers from different manufacturers needed a common way to represent text. Modern systems generally use Unicode encodings, but ASCII remains important because its original character values are preserved in UTF-8.

Background and development

The American Standards Association, now known as the American National Standards Institute (ANSI), standardized ASCII in the 1960s. The first published version appeared in 1963, followed by a revised version in 1967. ASCII was designed for communication and data processing, including teletype systems, where some codes needed to control equipment rather than represent visible characters.

The original standard uses seven bits per character, allowing 27, or 128, possible values. This was a practical fit for the systems of its era and left room for letters, digits, punctuation, and control functions. ASCII was an American standard, so its printable alphabet centers on basic Latin letters and does not include many characters needed for other languages.

How the codes work

Each ASCII character has a decimal value, which can also be written in binary or hexadecimal. The binary representation uses seven significant bits; storage systems commonly place those bits in an eight-bit byte, with the leading bit set to zero for standard ASCII.

  • A: decimal 65, hexadecimal 41, binary 1000001.
  • a: decimal 97, hexadecimal 61, binary 1100001.
  • 0: decimal 48, hexadecimal 30, binary 0110000 when shown as an eight-bit byte.
  • Line feed: decimal 10, hexadecimal 0A, a control code used to move to a new line in many contexts.

Some patterns make the table easier to understand. The decimal codes for digits 0 through 9 run consecutively from 48 to 57. Uppercase A through Z run from 65 to 90, and lowercase a through z run from 97 to 122. The difference between a corresponding uppercase and lowercase letter is 32 in the ASCII values: A is 65 and a is 97.

These numeric relationships can help software compare or transform basic text, but they do not mean that a computer inherently “knows” a character’s meaning. The code is a convention interpreted by software and hardware.

Printable characters and control codes

ASCII’s 128 values are commonly divided into control codes and printable characters. Codes 0 through 31, plus 127, are control codes. They include functions such as tab, carriage return, and line feed, as well as historical communication controls. Many do not produce a visible mark when displayed.

The printable range is decimal 32 through 126. It contains the space character, punctuation, digits, and English uppercase and lowercase letters. Code 32 is a printable space, while code 127 is DEL, a control code rather than a printable character.

“Printable” does not guarantee that every font or application will show a character identically. It means the code represents a character intended for display, rather than a control function. The precise appearance depends on the font and rendering software.

ASCII, extended ASCII, and Unicode

A common source of confusion is the phrase “extended ASCII.” Standard ASCII has only 128 codes. Because a byte has 256 possible values, different computer systems historically used values 128 through 255 for additional characters. Those extensions were not one universal standard: the same byte could represent different characters under different code pages.

Unicode addresses the need to represent writing systems and symbols from across the world. UTF-8, one widely used Unicode encoding, represents ASCII characters with the same byte values as standard ASCII. For instance, A is still the one-byte value 65. Characters outside ASCII—such as é, an em dash, or a character from another script—use more than one byte in UTF-8.

  • ASCII: 128 defined codes, suited to a basic set of English text and controls.
  • Code-page extensions: system-dependent uses of byte values above 127; compatibility can vary.
  • Unicode: a broad character standard, commonly encoded as UTF-8, UTF-16, or UTF-32.

ASCII is therefore not a synonym for Unicode, though it is a subset of UTF-8. A file containing only ASCII characters is valid UTF-8, but a UTF-8 file may contain many characters that are not ASCII.

Finding or using an ASCII value

To look up a value, identify the exact character and check an ASCII table or a programming-language reference. Be clear about whether the value is decimal, hexadecimal, or binary: 65, 41, and 1000001 can all describe the letter A when their number bases are understood.

In many programming languages, a character can be converted to its numeric code and back using built-in functions. The names and behavior of those functions vary by language, so check the relevant documentation. Also verify that the data is actually ASCII before interpreting its bytes this way. A UTF-8 text file with non-ASCII characters cannot be read correctly by treating every byte as an independent ASCII character.

ASCII is useful for simple identifiers, protocol fields, and text that is deliberately restricted to its character set. It is not enough for general multilingual writing, and using it as though it covers every character can lead to garbled text or failed conversions.

Frequently Asked Questions

What does ASCII stand for?
ASCII stands for American Standard Code for Information Interchange.

How many characters are in ASCII?
Standard ASCII defines 128 codes, numbered from 0 to 127. Some are control codes, and the rest are printable characters.

Is ASCII the same as UTF-8?
No. ASCII is a 128-code standard. UTF-8 is a Unicode encoding that uses the same byte values for ASCII characters and can also represent a much larger range of characters.

What is the ASCII code for A?
Uppercase A is decimal 65, hexadecimal 41, or binary 1000001 using seven bits. In an eight-bit byte, it is commonly written 01000001.

Why does “extended ASCII” have different meanings?
It refers informally to various systems that assigned characters to byte values 128 through 255. Since those extensions were not a single universal mapping, their characters could differ between systems.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →