skip to content

HTML: ASCII Character Codes

The table below presents all ASCII characters with codes from 32-127 and 160-255. The missing characters (0-27 and 128-159) are 'control characters' and not normally suited for output in HTML. The 'Entity' column gives the equivalent HTML character entity - where one exists.

If you're looking for a way to encode text - for protecting email links for example - you can use this form to encode a short string:

Text to be HTML-encoded:
Output:

For other types of encoding in JavaScript or PHP refer to the article Escaping Special Characters.

HTML Character Codes and Entities

This table is dynamically generated.

DecimalSymbolEntityOctalHex
32 4020
33!4121
34""4222
35#4323
36$4424
37%4525
38&&4626
39'4727
40(5028
41)5129
42*522A
43+532B
44,542C
45-552D
46.562E
47/572F
4806030
4916131
5026232
5136333
5246434
5356535
5466636
5576737
5687038
5797139
58:723A
59;733B
60<&lt;743C
61=753D
62>&gt;763E
63?773F
64@10040
65A10141
66B10242
67C10343
68D10444
69E10545
70F10646
71G10747
72H11048
73I11149
74J1124A
75K1134B
76L1144C
77M1154D
78N1164E
79O1174F
80P12050
81Q12151
82R12252
83S12353
84T12454
85U12555
86V12656
87W12757
88X13058
89Y13159
90Z1325A
91[1335B
92\1345C
93]1355D
94^1365E
95_1375F
96`14060
97a14161
98b14262
99c14363
100d14464
101e14565
102f14666
103g14767
104h15068
105i15169
106j1526A
107k1536B
108l1546C
109m1556D
110n1566E
111o1576F
112p16070
113q16171
114r16272
115s16373
116t16474
117u16575
118v16676
119w16777
120x17078
121y17179
122z1727A
123{1737B
124|1747C
125}1757D
126~1767E
1271777F
DecimalSymbolEntityOctalHex
160 &nbsp;240A0
161¡&iexcl;241A1
162¢&cent;242A2
163£&pound;243A3
164¤&curren;244A4
165¥&yen;245A5
166¦&brvbar;246A6
167§&sect;247A7
168¨&uml;250A8
169©&copy;251A9
170ª&ordf;252AA
171«&laquo;253AB
172¬&not;254AC
173­&shy;255AD
174®&reg;256AE
175¯&macr;257AF
176°&deg;260B0
177±&plusmn;261B1
178²&sup2;262B2
179³&sup3;263B3
180´&acute;264B4
181µ&micro;265B5
182&para;266B6
183·&middot;267B7
184¸&cedil;270B8
185¹&sup1;271B9
186º&ordm;272BA
187»&raquo;273BB
188¼&frac14;274BC
189½&frac12;275BD
190¾&frac34;276BE
191¿&iquest;277BF
192À&Agrave;300C0
193Á&Aacute;301C1
194Â&Acirc;302C2
195Ã&Atilde;303C3
196Ä&Auml;304C4
197Å&Aring;305C5
198Æ&AElig;306C6
199Ç&Ccedil;307C7
200È&Egrave;310C8
201É&Eacute;311C9
202Ê&Ecirc;312CA
203Ë&Euml;313CB
204Ì&Igrave;314CC
205Í&Iacute;315CD
206Î&Icirc;316CE
207Ï&Iuml;317CF
208Ð&ETH;320D0
209Ñ&Ntilde;321D1
210Ò&Ograve;322D2
211Ó&Oacute;323D3
212Ô&Ocirc;324D4
213Õ&Otilde;325D5
214Ö&Ouml;326D6
215×&times;327D7
216Ø&Oslash;330D8
217Ù&Ugrave;331D9
218Ú&Uacute;332DA
219Û&Ucirc;333DB
220Ü&Uuml;334DC
221Ý&Yacute;335DD
222Þ&THORN;336DE
223ß&szlig;337DF
224à&agrave;340E0
225á&aacute;341E1
226â&acirc;342E2
227ã&atilde;343E3
228ä&auml;344E4
229å&aring;345E5
230æ&aelig;346E6
231ç&ccedil;347E7
232è&egrave;350E8
233é&eacute;351E9
234ê&ecirc;352EA
235ë&euml;353EB
236ì&igrave;354EC
237í&iacute;355ED
238î&icirc;356EE
239ï&iuml;357EF
240ð&eth;360F0
241ñ&ntilde;361F1
242ò&ograve;362F2
243ó&oacute;363F3
244ô&ocirc;364F4
245õ&otilde;365F5
246ö&ouml;366F6
247÷&divide;367F7
248ø&oslash;370F8
249ù&ugrave;371F9
250ú&uacute;372FA
251û&ucirc;373FB
252ü&uuml;374FC
253ý&yacute;375FD
254þ&thorn;376FE
255ÿ&yuml;377FF

For details on non-ASCII characters supported in HTML follow the link under References below.

So why do we need all these different ways of referencing the same characters? The Decimal values are rarely used, but Octal codes turn up in various programming languages and the Hex values in URL-encoded strings (%20 represents a space for example). In HTML content the Symbol is used except where a proper Character Entity is available.

For more information on encoding special characters see the related article linked below.

Common Windows-1251 Character Codes

If your data has been corrupted with Windows-specific characters such as: smart quotes, ellipses, dashes and non-breaking spaces, the following list might be useful:

DecimalOctalDescriptionPlain Text Alternative
133\205ELLIPSIS...
145\221HIGH 6 SINGLE QUOTE'
146\222HIGH 9 SINGLE QUOTE'
147\223HIGH 6 DOUBLE QUOTE"
148\224HIGH 9 DOUBLE QUOTE"
149\225LARGE CENTERED DOT*
150\226EN DASH-
151\227EM DASH- or --
160\240NO-BREAK SPACE(space)

Other replacement values are also possible including various valid HTML entities (see above) or multibyte characters.

The reason for the \ in front of the Octal code for these characters is so that we can use them in regular expressions as shown here:

$output = mb_eregi_replace("\205", "...", $input);

You might find this necessary when converting data to UTF-8 or other multibyte character formats. For non-multibyte formats you can use the regular preg_replace or ereg_replace functions instead as there's no danger of corrupting the text by accidentally replacing one byte of a multibyte character.

References

< HTML


Like Tweet     Bitcoin

Send Feedback

Use this form to send a message to The Art of Web:


used only for us to reply, and to display your gravatar.

CAPTCHA refresh

<- copy the digits from the image into this box

press Esc or click outside this box to close

Load Feedback Form

top