Free · Instant · Client-Side Only
Escape HTML special characters to entities or decode entities back to plain text. Essential for safe HTML output and preventing XSS.
Common Entities
What are HTML entities?
HTML entities are special codes representing characters that have meaning in HTML markup. For example, < starts a tag, so to display a literal < you write <. The five essential entities: & (&), < (<), > (>), " ("), ' ('). Named entities also exist for symbols: © (©), ™ (™), (non-breaking space).
Why do I need to encode HTML entities?
Encoding prevents two problems: broken HTML (unescaped < can be misread as a tag, breaking your layout) and XSS (Cross-Site Scripting) attacks — where attackers inject <script>alert(1)</script> which runs as code. Always HTML-encode user input before inserting it into HTML. Modern frameworks like React do this automatically for JSX expressions.
What is the difference between HTML encoding and URL encoding?
HTML encoding converts special characters to &name; or &#num; entities safe for HTML content. URL encoding converts characters to %XX hex values safe for URLs. They serve different contexts: HTML encoding for content inside HTML documents, URL encoding for query parameters in URLs. Never swap them.
Does React/Vue automatically escape HTML?
Yes. React, Vue, and Angular automatically HTML-encode text in template expressions ({} in JSX, {{}} in Vue). This is the main XSS prevention mechanism. You must explicitly opt in to raw HTML (dangerouslySetInnerHTML in React, v-html in Vue) — only do so with properly sanitized, trusted content.
What is and when should I use it?
is a non-breaking space that prevents line breaks at that position. It keeps words together (10 km), prevents empty cells from collapsing in tables, and adds visible spacing in HTML (multiple normal spaces collapse to one). In modern development, prefer CSS white-space: nowrap or margin/padding for layout instead of .
What are numeric HTML entities and when do I use them?
Numeric entities reference a character by its Unicode code point: A = A (decimal), A = A (hex). They work for any Unicode character, including those without named entities. Useful for characters that might be misinterpreted in source files, unusual symbols, and ensuring cross-browser compatibility.
| Feature | Anvya AI | htmlentities.com | Browser console |
|---|---|---|---|
| Encode + Decode in one place | ✓ | Partial | Partial |
| Quick character reference panel | ✓ | ✗ | ✗ |
| Swap output to input | ✓ | ✗ | ✗ |
| Change count shown | ✓ | ✗ | ✗ |
| No ads | ✓ | ✗ | ✓ |
| Works offline | ✓ | ✗ | Partial |
| Free forever | ✓ | ✓ | ✓ |