✏ ENTER YOUR TEXT INPUT
💥 Please enter some text first!
📚 TRY AN EXAMPLE — CLICK TO ENCODE! EXAMPLES
HTML + Script
Hello & "World" <script>
↓ Encode to entities
HTML Tag
<div class="hero">...
↓ Decode to plain HTML
Price Text
Price: $5 & Tax: 10%...
↓ Encode safely
Named Entities
&copy; 2025 &mdash; DevDunia...
↓ Decode named entities
📋 COMMON HTML ENTITIES REFERENCE
Char Entity Name Numeric Description
&&amp;&#38;Ampersand
<&lt;&#60;Less than
>&gt;&#62;Greater than
"&quot;&#34;Double quote
'&apos;&#39;Single quote
 &nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright
®&reg;&#174;Registered
&trade;&#8482;Trademark
&mdash;&#8212;Em dash
🧠 HOW HTML ENTITIES WORK EXPLAINER
1

HTML parsers interpret characters like <, >, and & as markup syntax. To display them literally, they must be escaped.

2

Encoding uses a hidden <div> element — setting textContent automatically escapes all special chars via the browser's built-in HTML serializer.

3

Decoding does the reverse — setting innerHTML then reading textContent has the browser parse entities back to their actual characters.

4

This technique is critical for preventing XSS attacks — always encode user-supplied data before inserting it into HTML!