kb/data/developer.mozilla.org/en-US/docs/Glossary/Character_reference-0.md

13 KiB
Raw Blame History

title chunk source category tags date_saved instance
Character reference - Glossary | MDN 1/3 https://developer.mozilla.org/en-US/docs/Glossary/Character_reference reference web, html, css, javascript, documentation 2026-05-05T05:27:22.411155+00:00 kb-cron

MDN HTML HTML: Markup language

HTML reference

HTML guides

Markup languages

CSS CSS: Styling language

CSS reference

CSS guides

Layout cookbook

JavaScriptJS JavaScript: Scripting language

JS reference

JS guides

Web APIs Web APIs: Programming interfaces

Web API reference

Web API guides

All All web technology

Technologies

Topics

Learn Learn web development

Frontend developer course

Learn HTML

Learn CSS

Learn JavaScript

Tools Discover our tools

About Get to know MDN better

Blog

  1. Glossary
  2. Character reference

Character reference

An HTML character reference is an escape sequence of characters that is used to represent another character in the rendered web page. Character references are used as replacements for characters that are reserved in HTML, such as the less-than (<) and greater-than (>) symbols used by the HTML parser to identify element tags, or " or ' within attributes, which may be enclosed by those characters. They can also be used for invisible characters that would otherwise be impossible to type, including non-breaking spaces, control characters like left-to-right and right-to-left marks, and for characters that are hard to type on a standard keyboard. There are three types of character references:

Named character references

These use a name string between an ampersand (&) and a semicolon (;) to refer to the corresponding character. For example, &lt; is used for the less-than (<) symbol, and &copy; for the copyright symbol (©). The string used for the reference is often a camel-cased initialization or contraction of the character name.

Decimal numeric character references

These references start with &#, followed by one or more ASCII digits representing the base-ten integer that corresponds to the character's Unicode code point, and ending with ;. For example, the decimal character reference for < is &#60;, because the Unicode code point for the symbol is U+0003C, and 3C hexadecimal is 60 in decimal.

Hexadecimal numeric character references

These references start with &#x or &#X, followed by one or more ASCII hex digits, representing the hexadecimal integer that corresponds to the character's Unicode code point, and ending with ;. For example, the hexadecimal character reference for < is &#x3C; or &#X3C;, because the Unicode code point for the symbol is U+0003C. A very small subset of useful named character references along with their unicode code points are listed below.

Character Named reference Unicode code-point
& &amp; U+00026
< &lt; U+0003C
> &gt; U+0003E
" &quot; U+00022
' &apos; U+00027
&nbsp; U+000A0
&ndash; U+02013
&mdash; U+02014
© &copy; U+000A9
® &reg; U+000AE
&trade; U+02122
&asymp; U+02248
&ne; U+02260
£ &pound; U+000A3
&euro; U+020AC
° &deg; U+000B0
The full list of HTML named character references can found in the HTML specification here.

In this article

See also