HTML Encoder Decoder Online - HTML Entity Encoder & Decoder
Encode and decode HTML entities as you type. Convert special characters like <, >, &, quotes to HTML entities and vice versa. Perfect for displaying code on web pages.
How to Encode & Decode HTML
Choose Mode & Input Text
Pick Encode or Decode with the toggle button, then paste your HTML code or text. You can also use our HTML editor to prepare your code first.
Example: Encoding HTML
Input (before encoding):
<div class="example">Hello & Welcome</div>
Output (after encoding):
<div class="example">Hello & Welcome</div>
View Results
The output updates on its own, encoding or decoding HTML entities as you type. You can then validate the output using our HTML validator.
Common HTML Entities
< → <> → >& → &" → "Copy or Download
Copy the encoded/decoded text or download it as a file. You can also use our HTML beautifier to format the output or HTML viewer to preview it.
Frequently Asked Questions
What are HTML entities?
HTML entities are short codes that stand in for characters HTML would otherwise treat as markup. < shows a <, > shows a >, & shows an & and " shows a double quote. The browser displays the character instead of reading it as part of a tag.
Which characters does the encoder change?
Only five: & becomes &, < becomes <, > becomes >, a double quote becomes " and a single quote becomes '. Everything else stays exactly as you typed it, including accented letters, emoji, line breaks and long numbers like 8901240544102066246. A page served as UTF-8 shows those fine without entities.
Is the encoded text safe to put into my page?
It is safe as text between tags and as the value of an attribute wrapped in double or single quotes, because none of the five special characters survive. It is not enough on its own in other places: unquoted attributes, inside <script> or <style> blocks, or in a URL such as href="javascript:...". Those need their own escaping, so lean on your framework's output escaping or a sanitizer like DOMPurify rather than treating entity encoding as a full XSS fix.
Why does & turn into &amp;?
The encoder treats your input as plain text, so an entity that is already there gets encoded again. That is what you want when you need to show the entity code itself on a page, for example in a tutorial. If your text is already encoded and you want the characters back, switch to Decode instead.
How does decode mode handle unusual entities?
Decoding uses your browser's own HTML parser, so named, decimal (©) and hex (©) entities come out the same way a browser would show them. That includes the few legacy names a browser accepts without a semicolon, so a bare & followed by text still decodes to &. Nothing you paste is run as HTML; the result only goes into a plain text box.
Is this tool free, and is my text sent anywhere?
It is free and needs no sign-up. Encoding and decoding happen in your browser, so the text you paste is not uploaded to our server.
Related Tools
HTML Entity Decoder
Decode HTML entities back to plain text online. Convert &lt;, &gt;, &amp; and other HTML entities to their original characters
Punycode Converter
Encode and decode international domain names (IDN) using Punycode
Unicode Escape
Escape Unicode characters to \uXXXX notation for use in source code and JSON strings
Unicode Unescape
Convert \uXXXX Unicode escape sequences back to readable characters
HTML Viewer
View and preview HTML code online with safe rendering and structure analysis
HTML to Table
Extract and convert HTML tables to structured data with Excel export