left-pointing arrow for navigating to previous page

HTML Tutorial: Character Entities


right-pointing arrow for navigating to next page

With 50 or so keys on your keyboard, each with two characters (normal and shifted) you command about 100 characters. English is a simple language, when it comes to characters—almost no accent marks. (There are exceptions: resumé.) Other European languages use more. Germans love their umlauts. The French have their accents acute, grave and so on. Mathematicians around the world don't seem to be able to converse without upper and lowercase Greek letters.

Character Entities

Character entities let us handle all these (and more) without needing a ginormous keyboard. They all start with an ampersand (&) and end with a semicolon (;). In between is a word or abbreviation that suggests the result. The following table shows some common entities.

© ©, ® ®, ™ &#153
&amp; &, &lt; <, &nbsp;  
(&nbsp; = non-breaking space)
&iquest; ¿, &sect; §, &para;
&frac14; &frac14, &frac12; ½, &frac34; ¾
&sup1; ¹, &sup2; ², &sup3; ³
&cent; ¢, &euro; €, &pound; £, &yen; ¥
&Xaccent; where:
X = A a E e I i O o U u Y y
accent = acute circ grave uml
&Ouml; Ö &eacute; é
&Egrave; È &icirc; î

&Alpha; (Beta, Gamma, Delta...) Α Β Γ Δ
&alpha; (beta, gamma, delta...) α β γ δ

&ndash; –, &mdash;

These are a handful that I chose as generally useful to western webmasters. The full set runs to thousands in the default encoding. (Encoding: the translation of the bits that a computer sees to the characters that appear on your screen and come from your printer. The default works well except in Asia and Japan.)

Numbered Character Entities

Did you notice that the trademark symbol uses a numeric entity, &#143;? If you know a programming language, or are clever with your spreadsheet, you can generate a table of the first few thousand by using numbers.

How are you going to remember all these? You're not. In this tutorial, you'll need &copy;. Remember that one. When we get to the HTML Poster, from which these are taken, you'll see how to have this list close at hand. Computers are wonderful tools for remembering things.

Most browsers display most entities, but most browsers fail on less common entities. MSIE 6 does not display the euro symbol. My favorite browser fails on the left/right quotes that some webmasters, thinking like typesetters, carefully include.

You now have enough HTML smarts to make a serious start on an index.html that will look like something. (If you're here because you want to spruce up your blog, go ahead and make the web page anyway. You'll learn what you need to learn.)

Let's fix index.html!