HTML Unicode

Beginner
8 min read
Updated: Nov 2026
3 examples
UTF-8 / code points

Definition and Usage

Unicode is a standard character set that numbers and defines characters from the world’s languages, writing systems, and symbols. By giving every character a number—a code point—computers can store and mix many languages in one HTML file without guessing which legacy charset applies.

What does Unicode mean for HTML authors?

Your page text is almost always Unicode characters encoded as UTF-8 bytes. You declare that with <meta charset="UTF-8">, type characters directly in the source, or insert them with HTML character references that target a Unicode code point.

Why Unicode replaced older character sets

Before Unicode, one charset might store Japanese and another Arabic. If programs disagreed about which bytes meant which characters, text became garbled—mojibake (for example curly quotes turning into nonsense like £). Unicode + UTF-8 gives the web one shared map for letters, emoji, and symbols.

When do you use Unicode features in HTML?

On every modern page: set UTF-8, write multilingual content, and use numeric references when you need a specific code point in ASCII-only source or for reserved markup characters.

UTF-8 is the web default.

Other Unicode encodings exist (such as UTF-16), but UTF-8 is the recommended character encoding for HTML on the web.

Unicode ≠ UTF-8.

Unicode is the catalog of characters and code points. UTF-8 is one encoding of those code points into bytes. HTML pages should declare and save UTF-8.

Same character, three HTML forms.

The copyright sign is Unicode U+00A9. In HTML you can type © in a UTF-8 file, or write &copy;, &#169;, or &#xa9;—all decode to the same character.

HTML Syntax for Unicode

Declare UTF-8, then either type the character or reference its code point:

charset.html
<meta charset=" UTF-8">
numeric-refs.html
&# decimal;   or   &#xhex;

Decimal form: &#169;. Hexadecimal form: &#xa9; (or &#xA9;). Named entities such as &copy; also resolve to Unicode characters—see HTML Entities.

Core HTML Concepts

Terms that connect Unicode to everyday HTML markup:

ConceptMeaning in HTML
UnicodeStandard that assigns a unique code point to each character / symbol
Code pointThe number for a character, often written U+00A9
UTF-8Byte encoding of Unicode used by almost all HTML pages
<meta charset="UTF-8">Tells the browser how to decode the HTML file
&#…; / &#x…;Numeric character references that insert a Unicode code point
Named entityMnemonic such as &nbsp; that also maps to a Unicode character
MojibakeGarbled text from decoding with the wrong charset
Legacy charsetsISO-8859-1, Windows-1252, etc.—avoid for new HTML; prefer UTF-8

Unicode code points you will see in HTML

CharacterCode pointHTML (decimal / hex)
AU+0041&#65; / &#x41;
<U+003C&#60; / &lt;
©U+00A9&#169; / &#xa9;
  (NBSP)U+00A0&#160; / &nbsp;
Emoji 😀U+1F600&#128512; / &#x1F600;

How to Use Unicode in HTML

Lock in UTF-8, then choose typed characters or character references.

  1. Put <meta charset="UTF-8"> as early as possible in <head>.
  2. Save the .html file as UTF-8 in your editor (must match the meta declaration).
  3. Type letters, accents, and emoji directly when your toolchain is UTF-8.
  4. Use &#…; or &#x…; when you need an explicit code point, or named entities for common symbols.
  5. Always escape <, >, and & in text so the browser does not treat them as markup.
TaskHTML pattern
Declare encoding<meta charset="UTF-8">
Type Unicode<p>Café — 日本語 — 😀</p> (UTF-8 file)
Decimal reference&#169; → ©
Hex reference&#x1F600; → 😀

Live Preview

Pick a Unicode character and see how it appears as a typed character and as HTML numeric references.

Shows the glyph plus decimal and hex HTML references for the same code point.

Unicode in HTML

A

U+0041
&#65;
&#x41;

HTML Examples

Three short patterns: declare UTF-8, type Unicode text, and insert characters by code point.

Example 1 — Declare UTF-8 for Unicode Text

Every Unicode-friendly HTML page starts with an early charset declaration.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Unicode-ready HTML</title>
</head>
<body>
  <p>This file can hold any Unicode character.</p>
</body>
</html>
Try It Yourself

How It Works

  1. meta charset tells the browser which encoding maps bytes to Unicode characters.
  2. Place it early in <head> (within the first 1024 bytes).
  3. Save as UTF-8 in the editor so the declaration matches the file.
  4. lang still declares the human language; charset declares the byte encoding.

Example 2 — Type Unicode Characters Directly

With UTF-8, HTML source can contain accents, CJK characters, and emoji as literal text.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Mixed Unicode text</title>
</head>
<body>
  <p>Café — résumé — naïve</p>
  <p lang="ja">日本語のテキスト</p>
  <p>Symbols: © ® ™ — Emoji: 😀</p>
</body>
</html>
Try It Yourself

How It Works

  1. One encoding (UTF-8) carries every script in the same HTML file.
  2. Optional lang on elements helps accessibility for mixed-language pages.
  3. No entity required for these characters when the file is truly UTF-8.
  4. Wrong charset is what produces mojibake—not Unicode itself.

Example 3 — Numeric Character References

Insert a Unicode code point by decimal or hexadecimal reference in the HTML source.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Unicode references</title>
</head>
<body>
  <p>Copyright: &#169; or &#xa9; or &copy;</p>
  <p>Euro: &#8364; or &#x20ac;</p>
  <p>Grinning face: &#128512; or &#x1F600;</p>
  <p>Less-than must be escaped: &lt;price&gt;</p>
</body>
</html>
Try It Yourself

How It Works

  1. Decimal &#169; and hex &#xa9; name the same Unicode code point.
  2. Named entities like &copy; are shortcuts to those code points.
  3. Reserved characters in HTML text still need escaping (&lt;, &amp;).
  4. Browse more on the HTML Entities hub and topic pages.

Edge Cases & Pitfalls

Most Unicode problems in HTML are encoding mismatches, not missing characters.

mojibake

File encoding ≠ meta charset

Saving as Windows-1252 while declaring UTF-8 (or the reverse) garbles accents and symbols. Align both.

late

Charset declared too late

Put <meta charset> near the top of <head> so the browser does not guess wrong while parsing.

amp

Unescaped & in text

A bare & starts a character reference. Write &amp; for a literal ampersand.

utf16

Serving HTML as UTF-16

Possible but uncommon and easy to misconfigure. Prefer UTF-8 for HTML on the web.

http

HTTP Content-Type overrides meta

If the server sends Content-Type: text/html; charset=…, that charset wins. Keep server and HTML meta in sync.

legacy

Mixing old single-byte charsets

Latin-1 pages cannot hold emoji or most world scripts. Migrate legacy HTML to UTF-8 instead of patching per language.

Browser Support

UTF-8 HTML, Unicode text, and numeric character references are supported in all modern browsers.

✓ Baseline · Widely available

Unicode / UTF-8 in HTML

Browsers decode UTF-8 HTML and resolve &#…; / &#x…; references to Unicode characters everywhere users browse today.

100% UTF-8 &amp; character references
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
UTF-8 HTML documents Universal

Bottom line: Declare UTF-8 and use valid character references—Unicode support is not the bottleneck; encoding mismatches are.

Key Takeaways

  • Unicode numbers the world’s characters; HTML displays them as text.
  • UTF-8 is the encoding to declare and save for HTML on the web.
  • References: &#…; / &#x…; insert a Unicode code point in markup.
  • Mojibake means the wrong charset decoded the bytes—fix the mismatch.

One line: Unicode catalogs characters → UTF-8 encodes them in HTML files → type them or reference code points with &#…;.

Frequently Asked Questions

Unicode is a standard that assigns a unique number (code point) to characters from the world’s writing systems and symbols. HTML documents usually store those characters with the UTF-8 encoding and can also insert them with numeric character references.
No. Unicode is the character catalog (what each code point means). UTF-8 is one way to encode those code points as bytes in a file. HTML on the web almost always uses UTF-8.
Declare <meta charset="UTF-8"> early in head, save the .html file as UTF-8 in your editor, and type the characters directly—or use &#decimal; / &#xhex; character references.
A code point is the number Unicode assigns to a character, often written U+0041 for A or U+00A9 for ©. In HTML you can reference it as &#65; (decimal) or &#x41; (hex).
Mojibake is garbled text (for example curly quotes turning into £) when the browser or tool decodes bytes with the wrong character encoding. Matching UTF-8 in the file and in meta charset prevents it.
With UTF-8 you can type most characters directly. Use named or numeric character references for reserved markup characters (<, >, &) or when you want the code point visible in the source.

Next: HTML character references

Explore named entities and the full reference table for Unicode symbols in markup.

HTML Entities →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful