ASCII Table
All 128 ASCII codes in decimal, hex, octal and binary, with the HTML entity and JS escape. Right below, the 128 to 255 range of Windows-1252, where the accented letters live.
Columns
Click a cell to copy its value.
Table A: ASCII, 0 to 127
128 of 128 codes
| Dec | Hex | Oct | Binary | Character | Description |
|---|---|---|---|---|---|
| ^@ null character (NUL) | |||||
| ^A start of heading (SOH) | |||||
| ^B start of text (STX) | |||||
| ^C end of text (ETX), Ctrl+C | |||||
| ^D end of transmission (EOT), Ctrl+D | |||||
| ^E enquiry (ENQ) | |||||
| ^F acknowledge (ACK) | |||||
| ^G bell (BEL) | |||||
| ^H backspace (BS) | |||||
| ^I horizontal tab (TAB) | |||||
| ^J line feed, newline (LF) | |||||
| ^K vertical tab (VT) | |||||
| ^L form feed (FF) | |||||
| ^M carriage return (CR) | |||||
| ^N shift out (SO) | |||||
| ^O shift in (SI) | |||||
| ^P data link escape (DLE) | |||||
| ^Q device control 1 (DC1), XON | |||||
| ^R device control 2 (DC2) | |||||
| ^S device control 3 (DC3), XOFF | |||||
| ^T device control 4 (DC4) | |||||
| ^U negative acknowledge (NAK) | |||||
| ^V synchronous idle (SYN) | |||||
| ^W end of transmission block (ETB) | |||||
| ^X cancel (CAN) | |||||
| ^Y end of medium (EM) | |||||
| ^Z substitute (SUB), Ctrl+Z | |||||
| ^[ escape (ESC) | |||||
| ^\ file separator (FS) | |||||
| ^] group separator (GS) | |||||
| ^^ record separator (RS) | |||||
| ^_ unit separator (US) | |||||
| space | |||||
| exclamation mark | |||||
| double quote | |||||
| number sign, hash | |||||
| dollar sign | |||||
| percent sign | |||||
| ampersand | |||||
| single quote, apostrophe | |||||
| opening parenthesis | |||||
| closing parenthesis | |||||
| asterisk | |||||
| plus sign | |||||
| comma | |||||
| hyphen, minus sign | |||||
| period, full stop | |||||
| slash | |||||
| digit 0 | |||||
| digit 1 | |||||
| digit 2 | |||||
| digit 3 | |||||
| digit 4 | |||||
| digit 5 | |||||
| digit 6 | |||||
| digit 7 | |||||
| digit 8 | |||||
| digit 9 | |||||
| colon | |||||
| semicolon | |||||
| less-than sign | |||||
| equals sign | |||||
| greater-than sign | |||||
| question mark | |||||
| at sign | |||||
| uppercase letter A | |||||
| uppercase letter B | |||||
| uppercase letter C | |||||
| uppercase letter D | |||||
| uppercase letter E | |||||
| uppercase letter F | |||||
| uppercase letter G | |||||
| uppercase letter H | |||||
| uppercase letter I | |||||
| uppercase letter J | |||||
| uppercase letter K | |||||
| uppercase letter L | |||||
| uppercase letter M | |||||
| uppercase letter N | |||||
| uppercase letter O | |||||
| uppercase letter P | |||||
| uppercase letter Q | |||||
| uppercase letter R | |||||
| uppercase letter S | |||||
| uppercase letter T | |||||
| uppercase letter U | |||||
| uppercase letter V | |||||
| uppercase letter W | |||||
| uppercase letter X | |||||
| uppercase letter Y | |||||
| uppercase letter Z | |||||
| opening square bracket | |||||
| backslash | |||||
| closing square bracket | |||||
| caret, circumflex | |||||
| underscore | |||||
| backtick, grave accent | |||||
| lowercase letter a | |||||
| lowercase letter b | |||||
| lowercase letter c | |||||
| lowercase letter d | |||||
| lowercase letter e | |||||
| lowercase letter f | |||||
| lowercase letter g | |||||
| lowercase letter h | |||||
| lowercase letter i | |||||
| lowercase letter j | |||||
| lowercase letter k | |||||
| lowercase letter l | |||||
| lowercase letter m | |||||
| lowercase letter n | |||||
| lowercase letter o | |||||
| lowercase letter p | |||||
| lowercase letter q | |||||
| lowercase letter r | |||||
| lowercase letter s | |||||
| lowercase letter t | |||||
| lowercase letter u | |||||
| lowercase letter v | |||||
| lowercase letter w | |||||
| lowercase letter x | |||||
| lowercase letter y | |||||
| lowercase letter z | |||||
| opening curly brace | |||||
| vertical bar, pipe | |||||
| closing curly brace | |||||
| tilde | |||||
| ^? delete (DEL) |
Table B: 128 to 255
128 of 128 codes
| Dec | Hex | Windows-1252 | ISO-8859-1 | Unicode | UTF-8 bytes | HTML | UTF-8 read as Windows-1252 |
|---|---|---|---|---|---|---|---|
| C1 control | |||||||
| no character | C1 control | ||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| no character | C1 control | ||||||
| C1 control | |||||||
| no character | C1 control | ||||||
| no character | C1 control | ||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| C1 control | |||||||
| no character | C1 control | ||||||
| C1 control | |||||||
| C1 control | |||||||
This range is not ASCII. It is what people usually call extended ASCII, and each table puts something different here. The table shows Windows-1252 and ISO-8859-1 side by side, with the UTF-8 bytes and what you get when UTF-8 is read as Windows-1252.
Codes 0x81, 0x8D, 0x8F, 0x90 and 0x9D have no character in Windows-1252. In ISO-8859-1, the whole 128 to 159 range is C1 controls.
Alt codes on Windows
Hold Alt and type the number on the numeric keypad (the number row does not work). Without a leading zero, Alt+NNN uses CP850, the console code page of Windows in Portuguese, Spanish, French and German (in the US it is CP437). With a leading zero, Alt+0NNN uses Windows-1252.
| Character | Alt+NNN (CP850) | Alt+0NNN (Windows-1252) |
|---|---|---|
| not available | ||
What ASCII is
ASCII is a table of 128 codes, from 0 to 127, using 7 bits per character. It started in the 1960s as an American standard (ANSI X3.4) and is described in RFC 20. It holds the unaccented letters, the digits, punctuation and 33 control characters that never show up on screen.
Anything above 127 is no longer ASCII, even when someone calls it "extended ASCII".
Control characters you still meet every day
Most of the 33 control characters fell out of use, but a few turn up every week. NUL (0) ends a string in C and shows up in binary files. TAB (9) is the tab. LF (10) and CR (13) make the line break: Linux and macOS use LF alone, Windows uses the pair CR and LF (CRLF). ESC (27) starts the terminal color sequences, and DEL (127) is the only control outside the 0 to 31 range.
The line break difference causes real bugs, like a shell script that will not run because of a CR at the end of the line. Git can convert on commit and checkout, depending on core.autocrlf: true on Windows and input on Mac and Linux usually fixes it. In CSV, a line break inside a field is only read correctly when the field is quoted.
git config --global core.autocrlf inputThere is no single "extended ASCII"
When people say "extended ASCII" they almost always mean one of three tables: ISO-8859-1, Windows-1252 or CP850. They match from 0 to 127 and differ from there up. And the browser does not even treat "latin1" as ISO-8859-1: under the WHATWG Encoding Standard, "latin1", "iso-8859-1" and even "ascii" are read as Windows-1252.
ISO-8859-1 (from 1987) uses 128 to 159 for C1 controls, which nobody types. Windows-1252 puts useful symbols in those 32 codes, like €, “ ”, … and •, and leaves only five empty. CP850 is something else: it is the code page of the Windows console and of Alt codes, and there "ç" is 135, not 231.
When you need one of these tables, say its name. "ASCII" only goes up to 127.
ASCII, Unicode and UTF-8
Unicode is the list of all characters, and UTF-8 is the most common way to store them as bytes. From 0 to 127, UTF-8 uses one byte with the same value as ASCII, so a file with only ASCII is identical in both. Above that, each character takes 2 to 4 bytes: an accented letter takes 2, a symbol like € takes 3 and an emoji takes 4.
That matters when the limit is in bytes, like a database column or a header. The Character and Word Counter shows both numbers side by side. In JavaScript, note that length counts code units, not characters or bytes:
"ç".length // 1
new TextEncoder().encode("ç").length // 2
"😀".length // 2
new TextEncoder().encode("😀").length // 4Why "ç" turns into "ç"
"ç" in UTF-8 takes two bytes, C3 and A7. If a program reads those bytes as Windows-1252, each byte becomes its own character: C3 is "Ã" and A7 is "§". That is where "ç" comes from. Almost always one end is set up wrong: the database in latin1, the CSV saved without a BOM, the Content-Type header without a charset, or the file saved as "ANSI".
The usual suspects:
- A MySQL table in
latin1instead ofutf8mb4. Data goes in right and comes out wrong, or the other way around. - A UTF-8 CSV opened in Excel without a BOM. Excel assumes the Windows code page and shows mojibake.
- An HTTP response without
charsetin theContent-Typeheader. The browser guesses the encoding. - A file saved as "ANSI", which on Western European and Brazilian Windows is Windows-1252.
btoaonly takes characters up to 255.btoa("€")throwsInvalidCharacterError, andbtoa("ç")works but encodes the byte E7 (latin1), not C3 A7 (UTF-8). For Base64 of UTF-8, convert to bytes first. The Base64 Decoder does that.
btoa("€"); // InvalidCharacterError
btoa("ç"); // "5w==" (byte E7)
btoa(String.fromCharCode(...new TextEncoder().encode("ç"))); // "w6c=" (bytes C3 A7)ALTER TABLE clientes CONVERT TO CHARACTER SET utf8mb4;Hashes have the same problem: the SHA-256 of "ç" is not the same in latin1 (byte E7) and in UTF-8 (bytes C3 A7). If a hash does not match the other system's, check the text encoding in the Hash Generator.
ASCII in code
The table explains tricks that show up in all kinds of code. Uppercase and lowercase letters differ by 32 (a single bit), and the digits "0" to "9" sit at 48 to 57, so c - '0' in C or Java turns the character into a number. In regex, [ -~] matches printable characters, from space (32) to tilde (126).
"a".charCodeAt(0) - "A".charCodeAt(0); // 32
"7".charCodeAt(0) - "0".charCodeAt(0); // 7
/^[ -~]*$/.test("Olá"); // false
"B".charCodeAt(0) - 48; // 18The alphanumeric CNPJ uses the same idea. To compute the check digit, each character is worth its ASCII code minus 48: "0" to "9" still count 0 to 9, "A" is 17, "B" is 18 and so on up to "Z", which is 42. To see it working, use the CNPJ Generator or check a number in the CNPJ Validator.
HTML entities and escapes
In HTML you only need an entity for characters the parser reads as markup: &, < and >, plus " inside attributes. is the non-breaking space, code 160, and it is not the same as a regular space (32).
With the page in UTF-8, accents and symbols can go straight into the HTML: you do not need ç or ç. In JavaScript and JSON, the \u00e7 escape helps when the file is not UTF-8, and \n, \t and \ are the short forms. In a URL, "ç" becomes %C3%A7, which are its UTF-8 bytes.
Alt codes on Windows
Alt codes are not ASCII. Alt+NNN, without a zero, uses CP850 on Windows in Portuguese, Spanish, French and German: Alt+135 types "ç". Alt+0NNN, with a leading zero, uses Windows-1252: Alt+0231 types the same "ç". The number changes because the table changes.
Always type on the numeric keypad, with Num Lock on. On a laptop without a keypad, the easiest way is to copy the character from the table above.
Sources
Checked on November 3, 2026: