How to Use HTML Codes for Special Characters

Learn How to Put Special Characters on Your Web Pages with HTML Codes

3 grün is hard to type on a US keyboard
Special characters are most common in non-English languages. Image courtesy EyeEm / Getty Images

If you post a website in another language, refer to currency that's not on the keyboard, or want to represent more complex mathematical concepts you will need to use special characters. It is often easier to insert and use a special character on a web page, than to find the actual code to use.

Follow these simple steps to find the characters you need and add them to your web pages.

  1. Look up the character you need.
    First you want to look up the character you need to use. If it's a character based on a letter, start with the HTML Codes document, then you can move to the currency codes, mathematics codes, and punctuation codes.
  1. Place the code in your document.
    You can use the friendly name if there is one, the decimal numeric code, or the hexadecimal numeric code. I recommend using the decimal or hexadecimal codes. Not all browsers support the friendly codes, and if you need to load them into XML, the friendly codes will not be supported by most XML namespaces. But the numeric codes are.

    Some of the more common characters used are:

    •   - non-breaking space   or   or  
    • © - copyright © or © or ©
    • ™ - trademark ™ or ™ or ™ 
  2. Add the unicode declaration to your document head.
    Simply add the following meta tag anywhere inside the <head> of your web page. This will insure that your special characters display correctly.
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  3. Always check that you've ended your entity with a semi-colon (;).
    Some HTML editors will allow you to post HTML codes without the final semi-colon, but your pages will be invalid, and many web browsers won't display the entities correctly without it.
  1. Your entity should also begin with an ampersand (&).
    Many web editors will let you get away with leaving out the "amp;" when you display an ampersand alone (&), but I don't recommend getting into this habit. When my team switched to XHTML that was our most common validation error - ampersands that were not written as HTML entities with their valid HTML code: &amp;.
  1. Test your pages in as many browsers as you can.
    If the character is crucial to understanding your document, and you can't test it in the browser/OS combinations that your customers use, then you should find another way to represent it. But before you resort to images or something else, you should see if these browser testing tools can help you.