DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Semantic HTML
  • Accessibility (a11y)
  • Forms & Validation
  • Document Metadata & The <head>
  • The Document Object Model (DOM)
  • Character Encoding & Entities
  • Data Attributes & Custom Data
  • Template, Slot & Web Components
  • Responsive Images: Picture, Source & srcset
  • Loading Strategies & Resource Hints
  • The Native Dialog Element
  • Audio, Video & Media APIs
  • SVG Integration & Canvas Basics
  • Advanced Input Types & Datalist
  • Details, Summary, Progress & Meter
  • Global Attributes & Iframe Security
  • Microdata, Schema.org & Structured Data
  • Open Graph & Social Meta Tags
  • Security Headers & CSP in HTML
  • Link Relations & Canonical Tags
← From Beginner to Expert in Fundamentals of Frontend

Character Encoding & Entities

10 min read
UTF-8HTML EntitiesUnicodeEncoding DeclarationEmoji

Character Encoding: Making Text Work Everywhere

Character encoding defines how bytes map to characters. The web standard is UTF-8, supporting every character in every language plus emoji.

Why UTF-8 Matters

  • ASCII (old): Only 128 characters (English letters, numbers, basic punctuation)
  • Latin-1/ISO-8859-1: 256 characters (Western European languages)
  • UTF-8: 1,112,064 possible characters (every language, symbols, emoji)

HTML Entities

Some characters have special meaning in HTML. Use entities to display them:

CharacterEntityNumeric
<&lt;&#60;
>&gt;&#62;
&&amp;&#38;
"&quot;&#34;
Non-breaking space&nbsp;&#160;
©&copy;&#169;

Encoding Declaration Order

The charset declaration MUST be within the first 1024 bytes of the document. Place it as the very first element inside <head>.

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.