Member Sign In
Not a member?

A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.


It's fast and free.

Sign in with OpenID
Sign In
Webmonkey is a property of Wired Digital.
processing...
Join Webmonkey

Please send me occasional e-mail updates about new features and special offers from Wired/Webmonkey.
Yes No

Please send occasional e-mail offers from Wired/Webmonkey affiliated web sites and publications, and carefully selected companies.
Yes No

I understand and agree that registration on or use of this site constitutes agreement to Webmonkey's User Agreement and Privacy Policy.
Webmonkey is a property of Wired Digital.
processing...

Retrieve Sign In

Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.

or
Webmonkey is a property of Wired Digital.
processing...

Welcome to Webmonkey

A private profile page has been created for you.
As a member of Webmonkey, you can now:
  • edit articles
  • add to the code library
  • design and write a tutorial
  • comment on any Webmonkey article
Close
Webmonkey is a property of Wired Digital.

Sign In Information Sent

An e-mail has been sent to the e-mail address registered in this account.
If you cannot find it in your in-box, please check your bulk or junk folders.
Sign In
Webmonkey is a property of Wired Digital.

Write Symbols and Special Characters in HTML

/skill level/
/viewed/
0 Times

When you type regular letters, numbers, and characters from your keyboard into the body of an HTML document, they show up on your Web pages just as you typed them. But things aren't so easy in non-English speaking countries (and such places do exist - honest). Languages such as French, German, and Icelandic often use characters that are not found on your typical keyboard. Even in English, accents can distinguish a "résumé" from a "resume."

So how do you make special characters and accented letters show up on your pages? You use a special set of codes called character entities, which you insert into your HTML code and which your browser will display as the corresponding symbols or characters you want.

The most common character entities have been collected by the International Organization for Standardization and compiled in the Special Characters ISO Latin Alphabet No. 1 table, which includes special characters, letters with diacritical marks (accents, umlauts, etc.), and scientific and currency symbols. The Latin-1 table contains 255 characters.

There are two kinds of entities here:text and numeric. Both kinds begin with an ampersand ( &) and end with a semicolon ( ;).

The text entities use letters to represent a character, and they're designed to be easy to remember. So say you wanted to have the following sentence appear on your Web page:

"The © symbol stands for 'copyright.'"

Your HTML code would look like this:

"The © symbol stands for 'copyright.'"

Numeric entities are similar to text ones, but should be written in this form:&#x; - where the "x" represents a number between 0 and 255. It is very important to make sure that the # symbol precedes the number, or the entity will not work. So to make "The ��� symbol stands for 'copyright.'" with a numeric entity, your HTML would look like this:

"The © symbol stands for 'copyright.'"

As you can see, some characters (like ©) can be represented by either a text or a numeric entity.

A note of caution here:Many computers let you use keyboard shortcuts to create accented letters and special characters (for example, typing option + e will produce "é"). Beware, the shortcuts may not always work. The browser may read the character you created differently or not at all. This occurs because the code that is used to represent the character on the keyboard does not directly translate into Latin-1 and probably won't be read by your Web browser.

Sometimes, case can also be important. For example, é produces the é character, while É results in É.

So, that's entities in a nutshell. Keep in mind that not all entities are recognized by older browsers. You may want to bookmark our ISO entities page for future reference.

  • This page was last modified 23:45, 9 May 2008.
Edit this article
Reddit Digg
 
Subscribe now

Special Offer For Webmonkey Users

WIRED magazine:
The first word on how technology is changing our world.

Subscribe for just $10 a year