HTML Entities
Display special characters, symbols, and reserved HTML characters safely using HTML entities. Essential for proper text rendering and avoiding parsing conflicts.
What are HTML entities?
HTML entities are codes for characters that would otherwise be read as markup, or that are hard to type. The essential ones are < for <, > for >, & for & and " for ". Each entity starts with & and ends with ;, and you can also use numeric codes like © for ©.
<p>Use <p> for paragraphs.</p> <!-- shows: Use <p> for paragraphs. -->
<p>© 2025 Compileum · Terms & Privacy</p>
<p>10 km</p> <!-- non-breaking space -->Understanding HTML Entities
HTML entities are special codes that represent characters which have special meaning in HTML or characters that can't be easily typed. They prevent parsing conflicts and ensure proper display across all devices and browsers.
Safe Display
Display reserved HTML characters safely
International
Support for multiple languages and symbols
Universal
Consistent display across all browsers
Types of HTML Entities
Named Entities
< → < (less than)
> → > (greater than)
& → & (ampersand)
© → © (copyright)
€ → € (euro sign)
Numeric Entities
< → < (decimal)
< → < (hexadecimal)
© → © (decimal)
— → — (hex em dash)
€ → € (decimal euro)
Comprehensive HTML Entities Reference
Complete reference of HTML entities including mathematical symbols, currency signs, accented characters, arrows, and special punctuation.
Code Editor
<p>Show code safely: <p>Hello</p></p>
<p>Ampersand: Tom & Jerry</p>
<p>Non-breaking space keeps "10 km" together.</p>
<p>© ® ™ € £ → ♥</p>
<p>Numeric: © 🚀</p>Preview
Best Practices & Guidelines
When to Use Entities
- • Always encode <, >, and & in content
- • Use for quotation marks in attributes
- • Mathematical and scientific symbols
- • Copyright and trademark symbols
- • Non-breaking spaces and special spacing
Performance Tips
- • Use UTF-8 encoding when possible
- • Prefer named entities over numeric
- • Don't over-encode regular text
- • Use entities only when necessary
- • Test across different browsers
HTML Entities Checklist
- Always encode reserved HTML characters
- Use appropriate entities for symbols
- Test display across browsers
- Consider accessibility implications
- Use UTF-8 encoding properly
- Document entity usage for team
HTML Entities — step by step
Understand why entities exist
Some characters have special meaning in HTML (like < and >). To display them as literal text, you must use HTML entities so the browser doesn't interpret them as code.
🎯 Quick Check
Which HTML entity displays the less-than symbol as visible text?
HTML Entities: summary
Key points
- You must escape
<and&in text content; escape"inside double-quoted attribute values. is a non-breaking space that keeps two words on the same line. Don't use it for layout spacing.- With
<meta charset="UTF-8">you can type most symbols (©, €, emoji) directly.
Frequently asked questions
›How do I show HTML code on a web page?
Escape the angle brackets as < and >, and wrap the code in <pre><code>…</code></pre>.
›What is ?
A non-breaking space: a space that the browser won't wrap a line at and won't collapse with other spaces.