ASCII Code Table

ASCII (American Standard Code for Information Interchange) includes 128 characters (0-127). Codes 0-31 and 127 are control characters; 32-126 are printable characters.

How It Works

ASCII (American Standard Code for Information Interchange) encodes characters in 7 bits, giving code points 0–127, and became the de-facto standard for early computers. Code points 0–31 and 127 are control characters (e.g. LF, TAB, CR); 32–126 are printable (letters, digits, punctuation).

Because 7 bits only covers English, "extended ASCII" uses the 8th bit for 128–255, but that range has no single standard — Windows-1252, ISO-8859-1 and others disagree, which is why raw binary text often shows mojibake across systems.

When to Use This Table

This table is for mapping a character to its code point and byte. Debugging mojibake, validating an encoding conversion, or checking control-character numbers in a protocol all need it. But there is a prerequisite question: if your goal is human-readable text, the encoding scheme (UTF-8 / GBK / Shift-JIS) determines the outcome far more than the code point does; this ASCII table only matters once you are working at the byte level.

When not to consult it: you are handling Chinese, Japanese or emoji. This table covers the 7-bit 0-127 range; everything above 128 is extension territory interpreted differently by each encoding, so deriving non-ASCII bytes from this table is guaranteed to be wrong. Those questions belong to the Character Encodings page, not here.

Rule of thumb: consult this table when the number is 0-127 and you need to know what the byte means. Above 127, settle the encoding scheme first and only then talk code points. Conflating the two layers is the most common source of the mistake where a UTF-8 multi-byte sequence gets treated as several separate characters.

Another bad signal: you only want to know the length of a string. Character count, byte count and code point count are three different quantities. They coincide inside ASCII and diverge sharply outside it — a single emoji is typically one character, two code points and four UTF-8 bytes.

Boundaries and Common Pitfalls

  • Control character numbering varies by dialect

    The 0-31 and 127 range is control territory, but the mapping from number to action differs by dialect. Traditional ASCII assigns 7 to bell, 8 to backspace, 9 to tab, 10 to line feed and 13 to carriage return, while Windows consoles make backspace 8 and a newline the two-byte sequence 13 followed by 10. When writing a protocol across systems, never assume that 10 means newline; state which convention you are speaking.

  • There is no such thing as "extended ASCII"

    The 128-255 range is often called extended ASCII, but no single standard defines it. ISO-8859-1 (Latin-1) and Windows-1252 differ only across 0x80-0x9F, which is exactly the boundary between control and printable characters, so mixing them up makes an invisible position render as a glyph. This is the usual reason legacy systems show odd characters in some locales.

  • A code point is not a glyph

    The Unicode basic plane reserves many code points purely for visual compatibility with existing characters, including 494 compatibility characters that collapse under normalization. U+2126 OHM SIGN normalises to U+03A9 GREEK CAPITAL OMEGA; the U+FB01 ligature expands to two letters. Any exact string comparison, deduplication or validation that skips normalisation will treat visually identical strings as different.

  • Mixing hexadecimal and decimal is the most common conversion slip

    Code point 0x41 and 65 denote the same character A. Treating a hex value as decimal (or the reverse) yields an entirely unrelated character and raises no error, because the number itself is perfectly valid in JS. A good sanity check is the resulting string length: printable ASCII sits in 0x20-0x7E, so a decimal value outside that range is proof of a base mix-up somewhere.

How This Relates to Neighbours

For the byte structure and conversion relationships of GBK / Big5 / Shift-JIS / UTF-8, use the Character Encodings page; this one only covers the 7-bit 0-127 base range.

For code points, names and search across emoji and symbols, use the Emoji page, which is organised by code point rather than decimal.

Percent-encoding in URLs (%20, %E4%B8%AD) is a hexadecimal view of UTF-8 bytes — a different layer from character code points. Use the in-site URL encoding tools for that.

If the goal is debugging mojibake in production, the Character Encodings section on writer/reader encoding mismatch will locate the problem faster than any code point table.

Practical Snippet

Key points: (1) [...s] counts code points while s.length counts UTF-16 code units, so an emoji counts as 2 — any length limit gives a different verdict depending on which you use; (2) TextEncoder yields UTF-8 byte counts regardless of the real target encoding, so GBK needs separate calculation; (3) pair codePointAt with String.fromCodePoint and avoid charCodeAt, which returns only the leading surrogate half of a pair.

// Three string lengths: characters / code points / UTF-8 bytes
const s = 'A中🛠'

// ① Code point count (spread [...s] instead of s.length, which counts one emoji as 2)
const codePoints = [...s].length

// ② UTF-8 byte count (TextEncoder follows the spec: 3 bytes for CJK, 4 for emoji)
const bytes = new TextEncoder().encode(s).length

// ③ Compare all three layers: identical within ASCII, diverging fast beyond it
console.log({ charLength: s.length, codePoints, bytes })

// Code point ↔ character: use codePointAt, not charCodeAt (the latter misses the low surrogate)
const back = String.fromCodePoint(0x1f6e0)  // 🛠
const cp = back.codePointAt(0)

/* Typical result:
  { charLength: 5, codePoints: 3, bytes: 8 }
  charLength uses UTF-16 code units, so CJK counts 1 and emoji counts 2, hence 5;
  code points 3 ('A', the CJK character, the emoji); UTF-8 bytes 1+3+4 = 8.
  ⇒ When a length limit exists (DB fields, protocol headers) always state which measure you mean. */

Practical Notes

  • CRLF vs LF causes phantom blank linesWindows text uses CRLF (13, 10) while Unix uses LF (10). Read a CRLF file as Unix and every line ends with a stray \r, so $ anchors fail to match and string comparisons differ. Normalize line endings at the boundary.
  • Control characters must be escaped in JSON and URLsCode points 0–31 become \u0000–\u001f in JSON and percent-encoded in URLs (a tab is %09). Inlining them raw makes parsers error out or truncate the message, which happens constantly in log pipelines.
  • DEL (127) is not printableIt sits in the control range, is usually invisible in a terminal, and still consumes one byte. Visible-length counters must exclude 0–31 and 127 or they overcount, and input validation should reject those code points explicitly.

Data Sources

  • ANSI X3.4-1986
  • ISO/IEC 646
  • Unicode Standard (C0/C1 controls)

Codes, names and definitions above come from public specifications; we claim no originality over the specification data itself. The arrangement, Chinese annotations and practical notes on this page are written by us.

DECHEXCharName
00x00NULNull
10x01SOHStart of Heading
20x02STXStart of Text
30x03ETXEnd of Text
40x04EOTEnd of Transmission
50x05ENQEnquiry
60x06ACKAcknowledge
70x07BELBell
80x08BSBackspace
90x09HTHorizontal Tab
100x0ALFLine Feed
110x0BVTVertical Tab
120x0CFFForm Feed
130x0DCRCarriage Return
140x0ESOShift Out
150x0FSIShift In
160x10DLEData Link Escape
170x11DC1Device Control 1
180x12DC2Device Control 2
190x13DC3Device Control 3
200x14DC4Device Control 4
210x15NAKNegative Acknowledge
220x16SYNSynchronous Idle
230x17ETBEnd of Trans. Block
240x18CANCancel
250x19EMEnd of Medium
260x1ASUBSubstitute
270x1BESCEscape
280x1CFSFile Separator
290x1DGSGroup Separator
300x1ERSRecord Separator
310x1FUSUnit Separator
320x20SPSpace
330x21!Exclamation Mark
340x22"Quotation Mark
350x23#Number Sign
360x24$Dollar Sign
370x25%Percent Sign
380x26&Ampersand
390x27'Apostrophe
400x28(Left Parenthesis
410x29)Right Parenthesis
420x2A*Asterisk
430x2B+Plus Sign
440x2C,Comma
450x2D-Hyphen
460x2E.Period
470x2F/Slash
480x300Digit Zero
490x3111
500x3222
510x3333
520x3444
530x3555
540x3666
550x3777
560x3888
570x399Digit Nine
580x3A::
590x3B;;
600x3C<<
610x3D==
620x3E>>
630x3F??
640x40@@
650x41AUppercase A
660x42BB
670x43CC
680x44DD
690x45EE
700x46FF
710x47GG
720x48HH
730x49II
740x4AJJ
750x4BKK
760x4CLL
770x4DMM
780x4ENN
790x4FOO
800x50PP
810x51QQ
820x52RR
830x53SS
840x54TT
850x55UU
860x56VV
870x57WW
880x58XX
890x59YY
900x5AZUppercase Z
910x5B[[
920x5C\\
930x5D]]
940x5E^^
950x5F__
960x60``
970x61aLowercase a
980x62bb
990x63cc
1000x64dd
1010x65ee
1020x66ff
1030x67gg
1040x68hh
1050x69ii
1060x6Ajj
1070x6Bkk
1080x6Cll
1090x6Dmm
1100x6Enn
1110x6Foo
1120x70pp
1130x71qq
1140x72rr
1150x73ss
1160x74tt
1170x75uu
1180x76vv
1190x77ww
1200x78xx
1210x79yy
1220x7AzLowercase z
1230x7B{{
1240x7C||
1250x7D}}
1260x7E~~
1270x7FDELDelete

Frequently Asked Questions

What is ASCII?

ASCII (American Standard Code for Information Interchange) uses 7 bits to represent 128 characters including letters, digits, punctuation and control characters — the most basic character encoding.

How is ASCII related to Unicode?

ASCII covers only 128 characters; Unicode is a superset that is compatible with the first 128 ASCII code points and extends to every writing system. UTF-8 is an ASCII-compatible Unicode encoding.

What are control characters?

Code points 0-31 and 127 are control characters (e.g. LF, CR, Tab) that are not printable; they are used for device control and text formatting.

Why represent ASCII in hex?

Hexadecimal is more compact and readable than binary or decimal (0x41 = "A"), and is most common when debugging protocols and parsing messages.

How do I look up the ASCII code of a character?

Find the character in the Char column of the table above; the DEC value on its left is the ASCII code and HEX is the hexadecimal form. For example "A" is 65 (0x41), the space (SP) is 32 (0x20), and line feed (LF) is 10 (0x0A).