Character Entity References are your Friends
When you are writing content to be served on the Internet, be sure to use proper character entity references for common characters such as ampersands, double quotes, and more.
Below is a short list of examples to show you what I mean:
- When your goal is left and right double quotes, don’t use these characters (created by holding the Shift key and pressing the double quote key on common keyboards):
" " - Instead, type these characters:
“” - This is how they look in a browser: “ ”
- When your goal is an ellipsis, don’t use three periods:
... - Instead, type these characters:
… - This is how it looks in a browser: …
- When your goal is to represent inches and feet or seconds and minutes, don’t use these characters:
"' - Instead, type these characters:
″′ - This is how they look in a browser:
″′
- When your goal is an ampersand don’t use only an ampersand by itself (created by holding the Shift key and pressing the 7 key on common keyboards):
& - Instead, type these characters:
& - This is how it looks in a browser:
&
- When your goal is to write a less-than or greater-than sign, don’t use these characters by themselves:
<> - Instead, type these characters:
<> - This is how they look in a browser:
<>
- When your goal is to write some common fractions, don’t type a number, then a forward slash followed by another number:
1/41/23/4 - Instead, type these characters:
¼½¾ - This is how they look in a browser:
¼½¾




This site has a good number of common characters. I personally dig » “»” and « “«”.
Angelo
2 Jan 08 at 7:43 pm
I use the character entities you mentioned as opposed to numeric entities because they’re much easier to remember, but used to work with a developer who insisted on numeric. What’s the most compelling reason to use one over the other?
Tom
9 Jan 08 at 11:10 am
@Tom – I agree with you 200%, but I believe the reason to use numeric entities is wider support in different character sets… or something like that.
Marc
9 Jan 08 at 1:11 pm
Re: numeric entities – the default XML namespace has only limited support for named entities. For instance, the non-breaking space ( ) isn’t one of them even though it’s very common. You can either define a new named entity in each XML document you create, or used the numeric entities instead.
Chris Bloom
22 Aug 08 at 12:40 pm
[...] Proper use of character entities: I won’t get into character entity specifics in this article, since I wrote a separate article earlier and I’m lazy. Head over to the article to learn more about these little gems of HTML and be sure to use them regularly in your body content: Character Entity References are your Friends [...]
Website Front-end Quality Control Considerations at MarcAmos.com
12 Dec 08 at 2:08 pm