HTML Entity Encoder & Decoder
Convert special characters to HTML entities and back. 100% client-side — your data never leaves your browser.
No data sent to serverRelated Tools
What are HTML Entities?
HTML entities are escape sequences that let you display characters with special meaning in HTML — or characters hard to type. The most critical: < for <, > for >, & for &. Without escaping, the browser interprets these as HTML markup, breaking your page layout — or worse, creating XSS vulnerabilities.
Three entity formats
The HTML5 spec (WHATWG Living Standard) defines three equivalent ways to encode a character:
- Named entities:
©(©),→(→),—(—) - Decimal numeric:
©(©) — Unicode code point in decimal - Hex numeric:
©(©) — Unicode code point in hex
When to encode
- Displaying user input on an HTML page (always — XSS prevention)
- Showing code samples in
<pre>blocks - Embedding HTML strings inside attribute values
- Storing HTML in databases that serve to untrusted clients
- Email templates with user-supplied content
Common HTML Entities
Critical (must encode)
| Char | Named | Numeric |
|---|---|---|
| < | < | < |
| > | > | > |
| & | & | & |
| " | " | " |
| ' | ' | ' |
Punctuation and typography
| — (em dash) | — | — |
| – (en dash) | – | – |
| … (ellipsis) | … | … |
| ' (curly apostrophe) | ’ | ’ |
| " / " | “ / ” | “ / ” |
| © (copyright) | © | © |
| ® (registered) | ® | ® |
| ™ (trademark) | ™ | ™ |
| (non-breaking space) | |   |
Math and symbols
× (multiply) × × ÷ (divide) ÷ ÷ ± (plus/min) ± ± ≈ (approx) ≈ ≈ ≠ (not eq) ≠ ≠ ≤ (less eq) ≤ ≤ ≥ (greater) ≥ ≥ ∞ (infinity) ∞ ∞ → ← ↑ ↓ → ← ↑ ↓
Note: The HTML5 spec (WHATWG) defines over 2,000 named entities. Most modern code uses numeric or named entities only for the few characters that absolutely need escaping; UTF-8 handles everything else natively.
Frequently Asked Questions
Does this support numeric entities like ©?
Yes. Both encoder and decoder handle named entities (©), decimal numeric (©), and hex numeric (© or ©).
Is this safe to use with sensitive content?
Yes. All processing happens in your browser. Verify in DevTools Network tab — no external requests are made when encoding/decoding.
Should I encode all non-ASCII characters?
No, with UTF-8 encoding (the modern default), non-ASCII characters like Korean or emoji can appear directly. Only escape the five HTML-significant characters (< > & " '). Force-encoding all non-ASCII just bloats your HTML.
What's the difference between ' and '?
Both produce '. ' is a named entity defined in HTML5 (not in HTML4). For maximum compatibility with very old systems, use '. In practice, all modern browsers accept both.
Do I need to encode characters inside <textarea>?
Yes — textarea is a content element, not a "raw text" element. < inside textarea must be encoded as < for correct rendering. <script> and <style> are exceptions (raw text elements).
Are HTML entities the same as URL encoding?
No, they're different. HTML entities (<) are for embedding in HTML. URL encoding (%3C) is for embedding in URLs. Don't mix them — wrong context produces double-encoded or broken output.
⚠️ Reference Only
Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.
Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.
📖 Related Guides
Color Formats — HEX, RGB, HSL, OKLCH
Modern CSS color formats explained. When to use OKLCH for perceptual uniformity.
REST vs GraphQL vs gRPC — Choosing an API Paradigm
Trade-offs across performance, tooling, type safety, and team shape. When to use each.
UUID v4 vs ULID — Which to Choose?
Compare UUID v4 and ULID for distributed systems. Performance, sortability, and use cases.