ASCII table and converter

All 128 ASCII codes in decimal, hex, octal and binary, plus a converter from text to ASCII codes and back. Free, no sign-up, and it runs in your browser.

Decimal codes

13 characters

72 101 108 108 111 44 32 87 111 114 108 100 33

ASCII table

All 128 ASCII codes with decimal, hex, octal and binary values. Search by character, name, number (65, 0x41) or control code (ESC, ^C).

DecHexOctBinaryCharNameHTML
0000000000000
NUL

Null

Ctrl ^@ · C escape \0

�
1010010000001
SOH

Start of heading

Ctrl ^A


2020020000010
STX

Start of text

Ctrl ^B


3030030000011
ETX

End of text

Ctrl ^C


4040040000100
EOT

End of transmission

Ctrl ^D


5050050000101
ENQ

Enquiry

Ctrl ^E


6060060000110
ACK

Acknowledge

Ctrl ^F


7070070000111
BEL

Bell

Ctrl ^G · C escape \a


8080100001000
BS

Backspace

Ctrl ^H · C escape \b


9090110001001
HT

Horizontal tab

Ctrl ^I · C escape \t

	
100A0120001010
LF

Line feed (new line)

Ctrl ^J · C escape \n



110B0130001011
VT

Vertical tab

Ctrl ^K · C escape \v


120C0140001100
FF

Form feed

Ctrl ^L · C escape \f


130D0150001101
CR

Carriage return

Ctrl ^M · C escape \r


140E0160001110
SO

Shift out

Ctrl ^N


150F0170001111
SI

Shift in

Ctrl ^O


16100200010000
DLE

Data link escape

Ctrl ^P


17110210010001
DC1

Device control 1 (XON)

Ctrl ^Q


18120220010010
DC2

Device control 2

Ctrl ^R


19130230010011
DC3

Device control 3 (XOFF)

Ctrl ^S


20140240010100
DC4

Device control 4

Ctrl ^T


21150250010101
NAK

Negative acknowledge

Ctrl ^U


22160260010110
SYN

Synchronous idle

Ctrl ^V


23170270010111
ETB

End of transmission block

Ctrl ^W


24180300011000
CAN

Cancel

Ctrl ^X


25190310011001
EM

End of medium

Ctrl ^Y


261A0320011010
SUB

Substitute

Ctrl ^Z


271B0330011011
ESC

Escape

Ctrl ^[


281C0340011100
FS

File separator

Ctrl ^\


291D0350011101
GS

Group separator

Ctrl ^]


301E0360011110
RS

Record separator

Ctrl ^^


311F0370011111
US

Unit separator

Ctrl ^_


32200400100000

SP

Space

 
33210410100001

!

Exclamation mark

!
34220420100010

"

Double quote

" "
35230430100011

#

Number sign (hash)

#
36240440100100

$

Dollar sign

$
37250450100101

%

Percent sign

%
38260460100110

&

Ampersand

& &
39270470100111

'

Apostrophe (single quote)

' '
40280500101000

(

Left parenthesis

(
41290510101001

)

Right parenthesis

)
422A0520101010

*

Asterisk

*
432B0530101011

+

Plus sign

+
442C0540101100

,

Comma

,
452D0550101101

-

Hyphen-minus

-
462E0560101110

.

Period (full stop)

.
472F0570101111

/

Slash

/
48300600110000

0

Digit 0

0
49310610110001

1

Digit 1

1
50320620110010

2

Digit 2

2
51330630110011

3

Digit 3

3
52340640110100

4

Digit 4

4
53350650110101

5

Digit 5

5
54360660110110

6

Digit 6

6
55370670110111

7

Digit 7

7
56380700111000

8

Digit 8

8
57390710111001

9

Digit 9

9
583A0720111010

:

Colon

:
593B0730111011

;

Semicolon

&#59;
603C0740111100

<

Less-than sign

&lt; &#60;
613D0750111101

=

Equals sign

&#61;
623E0760111110

>

Greater-than sign

&gt; &#62;
633F0770111111

?

Question mark

&#63;
64401001000000

@

At sign

&#64;
65411011000001

A

Uppercase A

&#65;
66421021000010

B

Uppercase B

&#66;
67431031000011

C

Uppercase C

&#67;
68441041000100

D

Uppercase D

&#68;
69451051000101

E

Uppercase E

&#69;
70461061000110

F

Uppercase F

&#70;
71471071000111

G

Uppercase G

&#71;
72481101001000

H

Uppercase H

&#72;
73491111001001

I

Uppercase I

&#73;
744A1121001010

J

Uppercase J

&#74;
754B1131001011

K

Uppercase K

&#75;
764C1141001100

L

Uppercase L

&#76;
774D1151001101

M

Uppercase M

&#77;
784E1161001110

N

Uppercase N

&#78;
794F1171001111

O

Uppercase O

&#79;
80501201010000

P

Uppercase P

&#80;
81511211010001

Q

Uppercase Q

&#81;
82521221010010

R

Uppercase R

&#82;
83531231010011

S

Uppercase S

&#83;
84541241010100

T

Uppercase T

&#84;
85551251010101

U

Uppercase U

&#85;
86561261010110

V

Uppercase V

&#86;
87571271010111

W

Uppercase W

&#87;
88581301011000

X

Uppercase X

&#88;
89591311011001

Y

Uppercase Y

&#89;
905A1321011010

Z

Uppercase Z

&#90;
915B1331011011

[

Left square bracket

&#91;
925C1341011100

\

Backslash

&#92;
935D1351011101

]

Right square bracket

&#93;
945E1361011110

^

Caret

&#94;
955F1371011111

_

Underscore

&#95;
96601401100000

`

Grave accent (backtick)

&#96;
97611411100001

a

Lowercase a

&#97;
98621421100010

b

Lowercase b

&#98;
99631431100011

c

Lowercase c

&#99;
100641441100100

d

Lowercase d

&#100;
101651451100101

e

Lowercase e

&#101;
102661461100110

f

Lowercase f

&#102;
103671471100111

g

Lowercase g

&#103;
104681501101000

h

Lowercase h

&#104;
105691511101001

i

Lowercase i

&#105;
1066A1521101010

j

Lowercase j

&#106;
1076B1531101011

k

Lowercase k

&#107;
1086C1541101100

l

Lowercase l

&#108;
1096D1551101101

m

Lowercase m

&#109;
1106E1561101110

n

Lowercase n

&#110;
1116F1571101111

o

Lowercase o

&#111;
112701601110000

p

Lowercase p

&#112;
113711611110001

q

Lowercase q

&#113;
114721621110010

r

Lowercase r

&#114;
115731631110011

s

Lowercase s

&#115;
116741641110100

t

Lowercase t

&#116;
117751651110101

u

Lowercase u

&#117;
118761661110110

v

Lowercase v

&#118;
119771671110111

w

Lowercase w

&#119;
120781701111000

x

Lowercase x

&#120;
121791711111001

y

Lowercase y

&#121;
1227A1721111010

z

Lowercase z

&#122;
1237B1731111011

{

Left curly brace

&#123;
1247C1741111100

|

Vertical bar (pipe)

&#124;
1257D1751111101

}

Right curly brace

&#125;
1267E1761111110

~

Tilde

&#126;
1277F1771111111
DEL

Delete

Ctrl ^?

&#127;

What this ASCII table does

The page has two parts. The converter at the top turns text into ASCII codes, or a list of codes back into text, as you type. Pick decimal, hex, binary or octal, and copy the result with one click. Below it is the full ASCII table: all 128 codes with their decimal, hex, octal and binary values, the character, its name, and its HTML code. Control codes also show their caret notation (such as ^C) and their C escape sequence (such as \n).

Everything runs in your browser. Nothing you type is stored or sent anywhere.

How to use it

  1. To get the codes for some text, keep Text to ASCII selected, choose a number base, and type or paste your text. The codes show below, separated by spaces.
  2. To read codes, select ASCII to text and paste the numbers. Spaces, commas, semicolons and new lines all work as separators, and hex codes can have a 0x prefix. If one item is not a valid number, the tool tells you which one.
  3. Select Swap to send the result back into the input and switch direction, which is a quick way to check a round trip.
  4. To look up a single character, search the table. Type the character itself, its name (tab, bracket), its decimal or hex code (65, 0x41), its binary code, or a control code such as ESC or ^C. Use the filter to show only the printable or only the control characters.

How ASCII is laid out

ASCII is a 7-bit character code, so it has 128 codes, from 0 to 127. RFC 20, which is still an Internet Standard, describes it for network use as "standard 7-bit ASCII embedded in an 8 bit byte whose high order bit is always 0".1 That is why every binary code in the table starts with a 0 when you write it as a full byte.

  • Codes 0 to 31 and 127 are control codes. They were made to control devices such as printers and terminals, not to print. A few are still in daily use: 9 is tab, 10 is line feed (the new line on Linux and macOS), 13 is carriage return (Windows ends lines with 13 then 10), and 27 is escape, which starts terminal color codes. RFC 20 lists the name of each one.1
  • Codes 32 to 126 are the 95 printable characters: the space, punctuation, the digits 0 to 9 (48 to 57), the uppercase letters (65 to 90) and the lowercase letters (97 to 122). MDN counts 33 non-printing control codes and 95 printable characters.2

The layout has useful patterns. A lowercase letter is its uppercase letter plus 32, so only one bit changes between A (1000001) and a (1100001). A digit's code minus 48 gives its value. And the caret notation of a control code is the character 64 places above it: code 3 is ^C because C is 67, which is why Ctrl+C sends code 3 in a terminal.

ASCII in code

In JavaScript, 'A'.charCodeAt(0) returns 65, and String.fromCharCode(72, 105) returns "Hi". Note that charCodeAt returns a UTF-16 code unit from 0 to 65535, so for characters outside the Basic Multilingual Plane, such as most emoji, MDN says to use codePointAt instead.3 fromCharCode takes UTF-16 code units in the same way.4 This converter reads whole code points, so an emoji stays one character with one code.

In HTML, any character can be written as a numeric reference, such as &#38; for the ampersand. The HTML standard also defines named references such as &amp;, &lt;, &gt; and &apos;.5 The table shows the numeric form for every character and the named form for the ones you most often need to escape.

If you work with key events, the keycode finder shows a related set of numbers: the letter keys A to Z have the keyCodes 65 to 90, the same as the uppercase ASCII codes. To make random IDs or tokens from a safe set of ASCII characters, use the random string generator.

Frequently asked questions