ASCII Table

Full ASCII code table from 0 to 127 in decimal, hexadecimal, octal and binary. Search by character or code, UTF-8 mapping explained, with practical examples.

Everything runs in your browser — your data is never sent to any server.

Why an ASCII code table still matters

The ASCII table is a reference of 128 codes mapping each number from 0 to 127 to a character: Latin letters, digits, punctuation marks and 33 control commands such as newline. The standard first appeared in 1963 and still underlies everything a screen prints. It saves you when a log shows an odd symbol and you need to know what code 10 or 27 means, when you write escape sequences in C and forget which letter has which number, or when a programming exercise asks you to break a string into codes. Search works both ways here: find the code from a character, or the character from a code.

What the reference offers

  • Shows all 128 codes at once in four notations: DEC, HEX, OCT and BIN, grouped into control and printable ranges
  • Searches by character, decimal code, hexadecimal 0x41, octal 101, or by name such as LF and ESC
  • Clicking any table row copies the decimal code to the clipboard
  • Converts any typed character to DEC, HEX, OCT and BIN, including code points outside ASCII
  • Explains separately how ASCII codes become UTF-8 bytes

How to find the code you need

  1. Type a code or a character into the search field — the table filters immediately
  2. Write the code any way you like: 65, 0x41, octal 0101, or just the letter A
  3. Click the matching row to copy the decimal code
  4. For an arbitrary character use the top field — it shows every notation including binary

How the table is built

ASCII encodes characters in seven bits: two to the seventh power gives 128 values, enough for the whole Latin alphabet in both cases, ten digits, punctuation and service commands. The range 0–31 plus code 127 belongs to control characters — they have no glyph, only a short name like NUL, LF or ESC. The range 32–126 holds the printable part, from space at code 32 to tilde at 126. Every code appears in decimal, hexadecimal, octal and binary: hexadecimal is convenient because one byte is exactly two hex digits, octal survives in C syntax, and binary shows what each individual bit is responsible for.

The ASCII codes you meet most often

Code DEC and HEXCharacterWhat it means
9, 0x09HThorizontal tab, \t in code
10, 0x0ALFline feed, \n on most systems
13, 0x0DCRcarriage return, \r; Windows ends lines with CR+LF
27, 0x1BESCstart of a terminal escape sequence
32, 0x20spacethe most frequent printable character in text
48–57, 0x30–0x390–9digits run in order; subtract 48 from the code
65–90, 0x41–0x5AA–Zuppercase Latin letters in order
97–122, 0x61–0x7Aa–zlowercase: uppercase code plus 32
34, 0x22"double quote, delimits strings in JSON
92, 0x5C\backslash, starts an escape sequence
126, 0x7E~the last printable character of the table
127, 0x7FDELdelete, the only control code after 31

Ranges 48–57, 65–90 and 97–122 are shown by their boundaries: inside each one the codes run without gaps, so between A and C there are always exactly two steps.

Where the ASCII table actually helps

The first mass of tasks is logs and protocols. In HTTP every header line ends with the byte pair 13 and 10, and until you know that, traffic between a client and a server looks like a pile of random symbols. In telemetry and exchanges with microcontroller devices, data often arrives as raw bytes: without the table you cannot tell whether 0x0A inside the stream is a separator or whether 0x1B opens a terminal command. Even parsing a CSV with an odd delimiter boils down to the question "what is the character with code 9", and the answer takes one search.

The second mass of tasks lives in programming. Escape sequences in C, Python and JavaScript are codes from this table: \n, \t, \r, \0. Comparing characters by code drives sorting: digits come before uppercase letters, uppercase before lowercase, and that is not a whim but a direct consequence of code order. Character-by-character parsing, input validation, hunting for unprintable characters in data — all of it leans on the ranges 0–31 and 32–126. Computer science exercises that ask you to turn a word into codes and back use the same table, and the underlying theory pairs well with the article on binary code.

  • Log analysis: what the byte 0x0A or 0x1B inside a stream means
  • Protocols: CR+LF in HTTP, delimiters on serial ports
  • Code: escape sequences \n, \t, \r and the NUL that ends C strings
  • Sorting: why digits sort before letters and uppercase before lowercase
  • Study tasks: convert a word to codes and rebuild it
  • Debugging: finding unprintable characters that break string comparison

Typical mistakes when working with codes

The most common mistake is mixing number systems. The numbers 65, 0x41 and 101 describe the same code, but read differently: 65 is decimal, 41 after 0x is hexadecimal, 101 is octal. Someone who sees byte 0x41 in a log sometimes looks up row 41 in the table and finds the wrong character: code 41 in decimal is a closing parenthesis. The rule is simple: determine the base first, then search. Hex is always recognizable by the letters A–F in the notation or by the 0x prefix.

The second mistake is extending the table to Cyrillic. The Russian capital А looks like the Latin A, but its Unicode code is U+0410, and in UTF-8 it takes the two bytes D0 90. String comparisons fail for exactly this reason when one letter is typed on a Latin layout and the other on a Cyrillic one, even though the text looks identical on screen. The related confusion is "a character equals a byte": in UTF-8 that holds only for the ASCII range, and a single emoji can take four bytes. To check what a file actually contains, start with the encoding detector.

  • 65, 0x41 and 101 are one code in three bases, not three different codes
  • Cyrillic is outside 0–127: the Russian А is U+0410, not 65
  • In UTF-8 a character above 127 takes two or more bytes
  • Space has code 32, not 0, and it is a printable character too
  • CR and LF are two different codes: Windows pairs them, Unix uses LF alone
  • DEL is 127, not 8: code 8 is backspace, moving one character left

Worked example: the letter A from code to byte

Take the uppercase Latin A and follow it through the table. The decimal code is 65, hexadecimal 0x41, octal 101, binary 01000001. All four notations describe the same byte content. In binary, two bits are set: the one weighted 64 and the one weighted 1, and 64 plus 1 gives exactly 65. The highest bit is zero — the code falls into the first 128 values, so the character is guaranteed to be in the table. The bit-level view also explains case switching: lowercase a is written 01100001, differing from the uppercase by the single bit weighted 32, which is why 65 plus 32 equals 97.

The same method works for any character in the table. Lowercase a differs from uppercase by exactly one bit: 01100001 versus 01000001. The digit 0 is 00110000, so all digits occupy 48–57 in a row. Space is 00100000: the only set bit is weighted 32, and the code of space really is 32. Below is a summary for the characters people come back to most.

Codes of frequent characters in every notation

CharacterDECHEX and OCT
A650x41, octal 101
a970x61, octal 141
0480x30, octal 060
space320x20, octal 040
LF (\n)100x0A, octal 012
CR (\r)130x0D, octal 015
ESC270x1B, octal 033
DEL1270x7F, octal 177

ASCII uses seven of the eight bits in a byte, so in pure ASCII the highest bit of every byte is zero; the eighth bit was historically reserved for parity checking.

ASCII among other ways of writing data

A code table is the bridge between text and numbers. From there numbers move freely between bases: 0x41 becomes 65 and 01000001, and every step of that is handled by the base converter. For long byte sequences, a binary translator works better than a table — it breaks a string into ones and zeros character by character, covered in more detail in the article on binary code. When bytes need to travel inside text, they get packed into Base64, where every three bytes become four characters; the mechanics are explained in the plain-language guide to Base64.

It helps to keep the limits in view too. ASCII covers only Latin letters with digits and signs: every other language needs other Unicode codes, arbitrary byte sequences need hex dumps, and files of unknown origin need an encoding check first. But because UTF-8 preserved all 128 codes as they were, the table remains a working tool rather than a museum piece: any byte below 128 you will decode from it as confidently as in 1963.

  • ASCII codes are the first 128 Unicode code points, with no deviations
  • A hex dump reads in digit pairs: each pair is one byte
  • A separate converter handles numbers between any bases
  • Base64 is not a character encoding but a way to pack bytes into text
  • Mojibake usually means a re-encoding mismatch, not broken data

Frequently asked questions

What is ASCII and how many characters does it have

ASCII stands for American Standard Code for Information Interchange. The standard defines 128 codes from 0 to 127, because every character is described by seven bits. Of those, 33 codes go to control commands that act rather than print: line feed, bell, carriage return. Another 95 codes cover printable characters: Latin letters in both cases, digits and signs. The first version of the standard was published in 1963; the modern edition is fixed as ANSI X3.4 and is also described by the international standard ISO/IEC 646.

How do control characters differ from printable ones

Printable characters 32–126 have a visible glyph: the letter A, a question mark, a space. Control codes 0–31 and 127 draw nothing — they command the device. Code 10 moves the print head one line down (LF, line feed), code 13 returns it to the start of the line (CR), code 7 rings the bell (BEL). DEL at 127 is a special case: historically it meant punching all seven holes in a paper tape, that is, zeroing the whole byte. In the table, control rows are marked with their abbreviation, which makes them easy to search by.

Why is A 65 while a is 97

Uppercase Latin letters occupy the range 65–90, lowercase 97–122, and the gap between any matching pair is exactly 32: 65 plus 32 equals 97, and 90 plus 32 equals 122. In binary, 32 is a single bit, so switching case comes down to flipping one bit, which old terminals did in hardware. Digits 0–9 received the range 48–57: subtract 48 from a digit's code and you get its value, which is why the old trick char c = '7' - '0' yields the number 7. These three ranges are worth memorizing — they cover most day-to-day tasks.

How do ASCII and UTF-8 relate

The first 128 code points of Unicode are exactly ASCII: the letter A has ASCII code 65 and Unicode code U+0041 at the same time. UTF-8 is built so that every code point in that range is stored as a single byte with the same value, which is why any plain ASCII text is already valid UTF-8 with no re-encoding. Characters with codes above 127 take two or more bytes: the Cyrillic capital А has code U+0410 and becomes the byte pair D0 90 in UTF-8. The practical rule: a byte below 128 in UTF-8 is guaranteed to mean the same character as in the ASCII table.

What do NUL, LF, CR and ESC mean

These are the names of control codes. NUL (0) is the empty byte; in the C language it terminates strings. LF (10) is line feed, the same as \n in code. CR (13) is carriage return, \r; the pair CR+LF ends lines in Windows and in the HTTP protocol. HT (9) is a tab, \t. ESC (27) opens terminal escape sequences: text color, cursor position. BS (8) erases the character to the left. The full list of 33 names is visible right in the table — click a row and the code lands in your clipboard.

How do I convert a code from HEX to a character

Hexadecimal notation is just another way to write the same number: 0x41 is 65, and code 65 in the table is the uppercase Latin letter A. One byte always takes two hex digits, so codes read naturally in pairs: 0x0A is line feed, 0x20 is space, 0x7F is DEL. To convert back, look at the table or compute: multiply the first hex digit by 16 and add the second. For general conversion between number systems, open the base converter — it handles numbers of any length.

Why does the table include octal codes

Octal notation came down from older systems: in C you can write '\101' and get the same letter A, because 101 in octal equals 65 in decimal. Octal codes still appear in escape sequences, in Unix file permissions (chmod 644 is three octal digits) and in the output of tools like od and hexdump. When you read such output, the table saves you mental arithmetic: type the octal code with its leading zero, for example 0101, and the table shows the character. For permissions specifically there is a separate chmod calculator.

When does the ASCII table stop helping

As soon as the text stops being Latin letters and digits. Cyrillic, em dashes, typographic quotes and emoji live beyond the range 0–127: they have their own Unicode codes, and searching them in the table returns nothing. The second trap is an unknown file encoding: if the text shows mojibake, first figure out what encoding the file is in, for example with the encoding detector, and only then look at codes. And if you want decorative banners made of characters, you do not need this table at all — the ASCII art generator does that.

Related articles

Related tools