List of Valid HTML Escape Characters

undefined

In this article, I will list almost all the valid escape characters used in HTML/XHTML. This topic may be seems odd as this web site is a Linux Technical blog, but I faced this issue when writing my articles web pages. Each time I write an option starting with “‐‐” it appears in my blog as this ““. This is a big issue for my visitors when they try my examples on a Linux systems, it returns error with “invalid options“. The solution I found is instead of writing double dash symbols in my posts I write it’s equivalent escape character twice, and the problem is solved. I decided to include the list of the valid escape characters here for all Sysadmins who writing a technical posts. Hopefully this will save you some time when creating/ formatting your web pages.

 

HTML escape character lists often include characters between 128 and 159 – the problem is that these are Microsoft specific, and are reserved for control characters in the standard Internet character sets. In HTML they are undefined, and in XHTML they are completely invalid. Here is a list of valid HTML/XHTML escape characters you should use.

Table of HTML Escape Characters

Decimal Value (&#DV;) Escape Character Output
0 – 031 None Nothing
032 &sp; or ␣ Blank
033 ! !
034 "
035 # #
036 $ $
037 % %
038 & &
039 '
040 ( (
041 ) )
042 * *
043 + +
044 , ,
045 ‐ or − or ‐
046 . .
047 / /
048-057 = digits 0-9
058 : :
059 ; ;
060 < <
061 &equals; =
062 > >
063 &quest; ?
064 &commat; @
065 – 090 = letters A – Z
091 &lsqb; [
092 &bsol; \
093 &rsqb; ]
094 ˆ or &caret; ^
095 &lowbar; _
096 None (grave accent/back apostrophe) `
097 – 122 = letters a – z
123 &lcub; {
124 &verbar; |
125 &rcub; }
126 &tilde; or &sim; ~
127 None (delete) None
128 – 159 = unused (MS specific)
160 &nbsp; non-breaking space
161 &iexcl; ¡
162 &cent; ¢
163 &pound; £
164 &curren; ¤
165 &yen; ¥
166 ¦ or &brkbar; ¦
167 &sect; §
168 &uml; or &die; ¨
169 &copy; ©
170 &ordf; ª
171 &laquo; «
172 &not; ¬
173 &shy; (soft hyphen) None
174 &reg; ®
175 ¯ or &hibar; ¯
176 &deg; °
177 &plusmn; ±
178 &sup2; ²
179 &sup3; ³
180 &acute; ´
181 &micro; µ
182 &para;
183 &middot; ·
184 &cedil; ¸
185 &sup1; ¹
186 &ordm; º
187 &raquo; »
188 &frac14; ¼
189 ½ or &half; ½
190 &frac34; ¾
191 &iquest; ¿

Hopefully you found this list of HTML escape characters useful. Note that not all lists published on the Internet will validate as valid HTML and XHTML. In some cases, if you’re editing in a plain text (i.e. no formatting is applied) environment, the use of an escape character is not necessary. This is the case with characters such as the apostrophe (‘), hyphen (-), quote (“), and others located as keys on your keyboard.

I hope this article is good enough for you.
See you in other articles.

If You Appreciate What We Do Here On Mimastech, You Should Consider:

  1. Stay Connected to: Facebook | Twitter | Google+
  2. Support us via PayPal Donation
  3. Subscribe to our email newsletters.
  4. Tell other sysadmins / friends about Us - Share and Like our posts and services

We are thankful for your never ending support.

Leave a Reply

Your email address will not be published. Required fields are marked *