HTML Entity Encoder / Decoder
Convert special characters to HTML entities and vice versa. Escape HTML for safe display in web pages.
Input
Plain TextOutput
HTML Entities
Common Use Cases
HTML Tags
<div class="container">Hello World!</div>
JavaScript Code
if (x < 10 && y > 5) { alert("Success!"); }
Special Symbols
© 2024 Company™ • All rights reserved ®
Math Expression
5 × 3 = 15, 20 ÷ 4 = 5, π ≈ 3.14
Quotes & Apostrophes
She said, "It's a beautiful day!"
International Text
Café • Résumé • Naïve • Piñata
Arrows & Symbols
← Previous | Next → ↑ Top ↓ Bottom
Currency Symbols
Price: $100 = €85 = £75 = ¥11,000
Multiple Formats
Support for named, decimal, and hexadecimal entity formats
XSS Prevention
Escape HTML to prevent cross-site scripting attacks
Entity Reference
Comprehensive searchable reference of common HTML entities
Real-time Conversion
Instant encoding and decoding as you type
Frequently Asked Questions
What are HTML entities?
HTML entities are special codes that represent characters in HTML. They start with an ampersand (&) and end with a semicolon (;). They're used to display characters that have special meaning in HTML or that might not be available on all keyboards.
When should I use HTML entities?
Use HTML entities when: displaying HTML code on a webpage, including special characters that might be misinterpreted by browsers, ensuring compatibility across different character encodings, preventing XSS attacks by escaping user input, or including symbols not readily available on keyboards.
What's the difference between named and numeric entities?
Named entities use descriptive names (like © for ©) and are easier to read and remember. Numeric entities use the character's Unicode number (like © for ©) and have better browser support. Hexadecimal entities are similar to numeric but use hex notation (like © for ©).
Do I need to encode all special characters?
No, you only need to encode characters that have special meaning in HTML (<, >, &, ", ') and characters that might not display correctly due to encoding issues. With UTF-8 encoding, most Unicode characters can be used directly without entities.