What Is ASCII?
Author: Domeny.ForSale editorial team Published
In brief: ASCII is a standard that assigns numbers from 0 to 127 to 128 characters, allowing text to be stored and transmitted as data. It includes English letters, digits, punctuation marks and control codes, but does not include Polish letters such as “ą” or “ł”. Modern text is usually stored in UTF-8, which remains compatible with ASCII for those first 128 characters.
How ASCII works and what its name means
ASCII stands for American Standard Code for Information Interchange. It is a character encoding: an established rule for mapping characters to numerical values. A computer stores numbers as bits, and a program reading the text interprets them according to the selected encoding.
ASCII is a 7-bit encoding. Seven bits can represent 128 different values, from 0 to 127. In files, each ASCII character usually occupies one byte, or eight bits, with the most significant bit set to zero.
For example, the uppercase letter A corresponds to the decimal number 65, written in hexadecimal as 41 and in binary within one byte as 01000001. These are three ways of representing the same value, not three different character codes. The notation 0x41, found in documentation and programming, indicates that hexadecimal value.
Which characters the ASCII table contains
ASCII contains 95 printable characters, including the space. The remaining 33 entries are control codes, which do not represent ordinary visible symbols. They are used, among other things, to indicate tabs or line endings.
| Character or function | Decimal code | Hexadecimal code |
|---|---|---|
| Tab (TAB) | 9 | 09 |
| Line feed (LF) | 10 | 0A |
| Carriage return (CR) | 13 | 0D |
| Space | 32 | 20 |
Digit 0 | 48 | 30 |
Uppercase letter A | 65 | 41 |
Lowercase letter a | 97 | 61 |
| Delete (DEL) | 127 | 7F |
A digit as a character is not the same as a number. The text 123 consists of three characters with ASCII codes 49, 50 and 51. A program must interpret this text as a number if it is to perform calculations with it.
Uppercase and lowercase letters have separate codes, so A and a are different characters. Similarly, a space is not an “absence of data”: it has its own code and takes up space in a file.
The CR and LF codes explain some of the differences between text files. On Unix-like systems, a line ending is usually represented by LF, while on Windows it is represented by the CRLF pair. Documents can therefore look identical in an editor even though they contain different byte sequences at the ends of lines.
ASCII, Unicode and UTF-8 — how they differ
ASCII does not include Polish letters with diacritics, the Greek alphabet, Cyrillic or emoji. Unicode supports text in multiple languages: it is a standard that assigns numbers called code points to characters and other text elements. UTF-8 is a way of storing those code points as sequences of bytes.
Unicode and UTF-8 are not synonyms. Among other things, Unicode specifies which number a given character has, while UTF-8 specifies how to store that number as data. ASCII combines a small character set with a simple numerical encoding.
The first 128 Unicode code points correspond to ASCII. In UTF-8, each of these characters is stored using exactly the same single byte as in ASCII. This means that a file containing only valid ASCII text is also a valid UTF-8 file.
The difference can be seen with the Polish word kot (“cat”): it occupies three bytes in both ASCII and UTF-8. The word żółw (“turtle”), however, cannot be stored in ASCII alone. In UTF-8, it occupies seven bytes: two each for ż, ó and ł, and one for w.
Why “extended ASCII” can be misleading
The term “extended ASCII” does not refer to a single universal encoding. It is sometimes used for various 8-bit encodings that preserve the ASCII range and use additional values from 128 to 255. These include Windows-1250 and ISO-8859-2, used for Central European text.
The same additional byte can represent a different character depending on the encoding. If a program reads a file using the wrong rule, incorrect symbols may appear instead of Polish letters. These are colloquially called “krzaki” in Polish, literally “bushes”, meaning garbled characters. Simply describing a file as “ASCII” is therefore not enough to describe a document containing characters outside the basic set.
When ASCII matters in practice
ASCII still appears in protocol documentation, file formats and form-field restrictions. A message saying “ASCII characters only” excludes, among other things, Polish letters, typographic quotation marks and long dashes. However, it does not automatically mean that the field accepts all ASCII characters: the rules or validator may allow only letters and digits.
If an imported file displays incorrect characters, follow this short procedure:
- Keep a copy of the original before you start saving changes.
- Check the encoding specified by the file’s source, for example in the export settings.
- Open the file in an editor using that encoding and check the Polish letters.
- Only after reading it correctly should you save a copy in UTF-8, if the destination system supports it.
For a new document containing Polish text, choose UTF-8 unless the recipient requires a different format. When you receive an “ASCII” requirement, also establish the exact set of permitted characters — this will help avoid data being rejected despite correct encoding.
See also: What Is AGI?
