HTML Entity Encoder & Decoder - HTML Encoding Tool
Encode text to HTML entities or decode HTML entity strings
Common HTML Entities
& → &< → <> → >" → "' → ' → (space)About this tool
A free online HTML entity encoder and decoder that converts between plain text and HTML entity format. HTML entities are special codes that represent characters in HTML, used when you can't directly type a character or when you need to escape special HTML characters. For example, the less-than symbol < becomes < and the ampersand & becomes &.
Our tool makes HTML encoding and decoding simple. Enter plain text and instantly encode it to HTML entities, or paste HTML-encoded text and decode it back to readable format. The tool handles all standard HTML entities including special characters, mathematical symbols, Greek letters, currency symbols, and Unicode characters.
HTML encoding is essential for displaying user-generated content safely on web pages, preventing XSS (cross-site scripting) attacks, displaying code examples in web pages, and creating valid HTML when you need to escape special characters. For example, if you display a user comment containing < or > characters on your website, you must encode them to prevent HTML injection.
How to use this tool
Choose your mode
Select "Encode HTML" to convert text to HTML entities, or "Decode HTML" to convert entities back to text.
Paste your content
Enter plain text in the left field (for encoding) or HTML-encoded text (for decoding). Processing is instant.
Review the result
See the encoded or decoded output in the right field. Special characters are converted to their entity equivalents.
Copy and use
Click Copy to copy the result to your clipboard, then paste into your HTML, CMS, or documentation.
Frequently Asked Questions
What are HTML entities and why do I need them?
HTML entities are codes that represent characters in HTML. Some characters (like <, >, &, ") are special in HTML and must be encoded to display correctly. For example, < becomes <. Using entities prevents browsers from misinterpreting your content as HTML tags and improves security.
Why is HTML encoding important for security?
If you display unencoded user input on your website (like comments or form data), malicious users can inject HTML/JavaScript. HTML encoding converts < to < and & to &, so the browser displays the text literally instead of executing it. This prevents XSS (Cross-Site Scripting) attacks.
What's the difference between & and &?
& is the literal ampersand character. & is the HTML entity that represents an ampersand. In HTML, you must write & because a bare & can confuse the parser. This tool automatically converts between them.
Can I encode special symbols like © or €?
Yes! This tool encodes all special characters including currency symbols (€, £, ¥), copyright (©), trademark (™), mathematical symbols (±, ×), and more. Both named entities (©) and numeric entities (©) are supported.
Do I need to encode everything in HTML?
No, only special characters. Regular letters, numbers, and most punctuation are safe. You only need to encode: < > & " ' and special symbols. This tool lets you safely encode content while keeping readable text as-is.