ASCII Code Cheatsheet - ASCII Character Encoding Reference

Protocol and encoding bugs usually boil down to "which byte is which char". This table lists ASCII 0–127 split into control and printable characters, each with decimal, hex, octal and the HTML entity, plus Latin-1 extension notes and per-language conversion tips. Use it to decode raw bytes, format terminal-control escapes, and understand what \n \r \t \0 really are. After reading you can translate between representations by hand.

Reference·61 commands·Last updated 2026-07-21
asciiEncodingCharacter Sets

Control Characters (0-31, 127) 13

0 (0x00)
NUL 空字符,C stringend标志
3 (0x03)
ETX 正文结束,Ctrl+C 发送中断信号
4 (0x04)
EOT 传输结束,Ctrl+D 表示Input结束 (EOF)
7 (0x07)
BEL 响铃,触发终端蜂鸣
8 (0x08)
BS 退格 Backspace
9 (0x09)
HT 水平制表符 Tab
10 (0x0A)
LF 换行 Line Feed
11 (0x0B)
VT 垂直制表符
12 (0x0C)
FF 换页 Form Feed
13 (0x0D)
CR 回车 Carriage Return
26 (0x1A)
SUB Replace,Ctrl+Z 挂起/EOF 标志
27 (0x1B)
ESC 转义 Escape,终端 ANSI 序列起始
127 (0x7F)
DEL Delete

Printable Characters (32-126) 8

32 (0x20)
空格 Space,最小可打印字符
33-47 (0x21-0x2F)
标点 ! " # $ % & ' ( ) * + , - . /
48-57 (0x30-0x39)
数字 0-9
58-64 (0x3A-0x40)
标点 : ; < = > ? @
65-90 (0x41-0x5A)
大写字母 A-Z
91-96 (0x5B-0x60)
标点 [ \ ] ^ _ `
97-122 (0x61-0x7A)
小写字母 a-z
123-126 (0x7B-0x7E)
标点 { | } ~

Common Control Characters 8

LF (10)
Unix/Linux/macOS line end符
CR (13)
经典 Mac OS(9 and以前)line end符
CRLF (13+10)
Windows/DOS line end符
HT (9)
Tab 制表符,缩进&对齐
ESC (27)
终端 ANSI 转义序列(颜色、cursor控制)
DEL (127)
Deletecursor后字符
NUL (0)
C 语言stringend标志
ETX (3)
Ctrl+C 向Process发送中断信号

Extended ASCII (128-255) 9

128-159 (0x80-0x9F)
扩展控制字符(C1 控制集)
160 (0xA0)
NBSP 不间断空格
169 (0xA9)
© 版权符号
174 (0xAE)
® 注册商标
176 (0xB0)
° 度数符号
177 (0xB1)
± 正负号
181 (0xB5)
µ 微符号
215 (0xD7)
× 乘号
247 (0xF7)
÷ 除号

Encoding Conversion Reference 7

A (65)
十六进制 0x41 / 八进制 0101 / 二进制 01000001
a (97)
十六进制 0x61 / 八进制 0141 / 二进制 01100001
0 (48)
十六进制 0x30 / 八进制 0060 / 二进制 00110000
空格 (32)
十六进制 0x20 / 八进制 0040 / 二进制 00100000
LF (10)
十六进制 0x0A / 八进制 0012 / 二进制 00001010
CR (13)
十六进制 0x0D / 八进制 0015 / 二进制 00001101
~ (126)
十六进制 0x7E / 八进制 0176 / 二进制 01111110

Language Conversion 8

JS 十进制转字符
String.fromCharCode(65) -> "A"
JS 字符转十进制
"A".charCodeAt(0) -> 65
JS 十进制转十六进制
(65).toString(16) -> "41"
JS 十六进制转十进制
parseInt("41", 16) -> 65
Python 十进制转字符
chr(65) -> "A"
Python 字符转十进制
ord("A") -> 65
Python 十进制转十六进制
hex(65) -> "0x41"
C 转义符
\n=10, \t=9, \r=13, \0=0, \\=92

快捷换算 Quick Conventions 8

大小写差值
同一字母大小写相差 32 (0x20)
大写转小写
加 32,即与 0x20 按位或("A" | 0x20 -> "a")
小写转大写
减 32,即与 0xDF 按位与("a" & 0xDF -> "A")
数字字符转数值
字符减去 48('0' -> 0)
可打印范围
32-126 共 95 个可打印字符
字母连续性
0-9: 48-57, A-Z: 65-90, a-z: 97-122
最大 ASCII
127 (0x7F) DEL,标准 ASCII 共 128 个
空格特殊性
32 是最小可打印字符,也是常见分隔符

Tips

  • ASCII covers only 0-127; beyond that use Unicode (e.g. UTF-8).
  • Newline is LF (10) on Linux/macOS, CRLF (13+10) on Windows — watch out when transferring text cross-platform.
  • Control characters are non-printable but used in protocol control (ESC sequences, terminal colors).
  • Upper/lower case differ by 32 (0x20): uppercase to lowercase OR 0x20; lowercase to uppercase AND 0xDF.
  • 128-255 is extended ASCII (Latin-1/ISO-8859-1), whose meaning varies by encoding (GBK/Shift-JIS).

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us