Thanks to Michael Czepiel for his technical input.
What’s a Code Point?
A codepoint is the numeric position of a character within an encoding system. Or more simply put, it’s the number that a computer can translate into a particular character.
In Unicode, code points are given in the form of U+ a four or six hexadecimal (Base 16) number. For example, the codepoint for capital A macron (Ā) is U+0100.
You can read more about the structure of codepoints and hexadecimal numbers in the Encoding Tutorial.
Finding a Codepoint
Codepoint lists can be found at Unicode and other locations. Here is a partial list of sites
- Unicode PDF charts
- Unicode Character Index
- Penn State list of charts
Note: Many accent code charts on this site include the code point.
Convert Codepoint to HTML Code
Below are some steps for finding and inserting a numeric code.
1. Look Up the Character Code
The Unicode Consortium and other sources provide Unicode charts.
Determine if the number is Hexadecimal or Decimal
Either hexadecimal (base 16) or decimal numbers (Base 10) can be used, but it is important to know which version the source uses. Please note.
- A hexadecimal chart will include the letters A-F. Also any codepoint from Unicode or cited as U+ is usually hexadecimal.
- A decimal chart is rarer and may be indicated with a term like "Base 10". All numeric values will only have the digits 0-9.
- Some charts, including some on this site, may list both values.
2. Place in entity code template
The hexadecimal template is
&#x<hex-number>; All codes begin with "&#" and end with a semicolon (;). A hexadecimal number
is signaled by the use of "x" after the "#" sign.
Since the codepoint for capital A macron (Ā) is U+0100, the entity code would be
Ā (either version works in many browsers).
The Decimal template
The decimal template is
&#<dec-number>; without the
x. However, you must make sure that your code is in a Base 10 numbner.
The hex number x100 for Ā is 16 cubed (163) or 16 × 16 × 16 or 256. The decimal entity code for capital A macron (Ā) is
Example Entity Codes
|Capital A with Macron (Ā)||Numeric Code||HTML Entity Code||Result|
3. Declare Unicode encoding on the page
Use the following code to declare that your HTML page is using
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4. Test on Multiple Browsers/Platforms
Browsers and content platforms may use prefer different forms of an entity code, so it’s wise to test a code in different platforms.
Also, so codepoint can be displayed unless the browser has access to the correct font. See the Languages page for information about each script and language.
The following tools are available to convert between hexadecimal and decimal numbers.
Windows Calculator App
You can use the free Calculator utility to convert hexadecimal number to decimal
numbers. To use this tool:
- Open the Calculator utility from the Start menu.
- Under the view options, switch from Standard to Programmer (Win 7/10) or Scientific (XP) to reveal more functions.
- Input a number and use the Dec and Hex controls to convert numbers back and forth.
Macintosh Calculator App
The Calculator application includes hex conversion and Unicode conversion calculator.
- Open the Calculator utility in the Applications folder.
- Under the View menu, switch from Basic to Programming (Command+3) to reveal conversion functions.
- Input a number and use the Dec and Hex toggles buttons to convert numbers back and forth.
- Click the Unicode button to display its equivalent Unicode glyph.