ASCII Table & Control Characters
ASCII 0–127 in decimal, hex, binary and text, with names, caret and escape notation for control characters like STX, ETX, ACK, NAK, CR, LF, XON and XOFF.
Control characters you meet on serial links
| Hex | Abbr. | Common use |
|---|---|---|
| 02 · 03 | STX · ETX | Mark the start and end of a frame. Many vendor protocols use «STX text ETX checksum» (whether the checksum covers STX varies by manual). |
| 05 | ENQ | Some protocols send it as a «please reply» request. |
| 06 · 15 | ACK · NAK | Received / not received (send again). |
| 0D · 0A | CR · LF | Line endings. Devices expect CR, LF or CR LF — if commands are ignored, match the line ending first. |
| 11 · 13 | DC1 · DC3 | Software flow control XON (resume) and XOFF (stop). With it enabled, raw 11 and 13 bytes must not appear in the data. |
| 1B | ESC | Starts terminal control sequences (ESC [ …). |
| 00 | NUL | Empty byte; some devices use it to end a string. |
128–255 and non-Latin text
- ASCII stops at 7 bits (0–127). Bytes 128–255 depend on the code page (ISO 8859-1, CP949 and others), so they are not in this table.
- Korean, Chinese and Japanese characters take several bytes — 3 in UTF-8, 2 in CP949 for Korean. Garbled text between a device and a PC usually means different encodings.
- Caret notation ^M is the code Ctrl+M produces (0x0D); the escape \r is how C-like languages write it in strings.
FAQ
What are CR and LF?
CR (carriage return) is 13 (0x0D) and LF (line feed) is 10 (0x0A). Windows text files end lines with CR LF (0D 0A).
Is the character '0' the same as the value 0?
No. The character '0' is 48 (0x30); the value 0 is NUL (0x00). A device sending numbers as ASCII sends '1' '2' '3' as 31 32 33.
How far apart are upper and lower case?
32 (0x20). 'A' is 65 (0x41) and 'a' is 97 (0x61) — they differ in one bit.
Is DEL (0x7F) a control character?
RFC 20 lists DEL with the control characters but notes that «in the strict sense, DEL is not a control character». This table marks it with the controls.
To turn bytes into text or text into bytes, use the HEX ↔ ASCII Converter.