The HTML Entity Encoder / Decoder converts special characters to HTML entities (&, <, >, ", ') or decodes HTML entities back to their original characters. Essential for safely inserting user-supplied text into HTML and for reading entity-encoded content.
HTML entities prevent XSS (cross-site scripting) attacks by ensuring characters with special meaning in HTML — like <, >, and & — are displayed as text rather than interpreted as markup.
This tool encodes the full set of HTML named entities and numeric character references. It handles both named entities (©, , —) and numeric references (©, —).
Everything runs in your browser. Your data never leaves your device.
Paste your text or HTML.
Select Encode (text → HTML entities) or Decode (entities → text).
Copy the result.
HTML encoding and URL encoding both use special escape sequences, but for different contexts. HTML encoding protects characters that have meaning inside HTML markup itself, like < and & — it's what keeps a script tag typed by a user from being interpreted as real code.
URL encoding protects characters that have meaning inside a URL, like spaces and &. A value might need both: text destined for a URL query parameter that will later be displayed on an HTML page may need URL encoding first, then HTML encoding when rendered — each protects against a different context.
HTML encoding converts characters like < and & that have special meaning in HTML into safe representations (< and &). This prevents XSS attacks and display errors when inserting user input into HTML.
< becomes <, > becomes >, & becomes &, " becomes ", and ' becomes '. These are the five characters with special meaning in HTML.
Paste the entity-encoded text and select Decode mode. & becomes &, < becomes <, > becomes >, and so on.
The default mode encodes only the five HTML-significant characters. Enable full Unicode mode to encode all non-ASCII characters as numeric HTML entities.
is the HTML entity for a non-breaking space — a space character that prevents the browser from wrapping the line at that point.
HTML-encoding output is one essential layer of XSS prevention, but a complete defense also depends on context (attributes vs. text vs. JavaScript) and, ideally, a templating system that auto-escapes by default. Use this tool to understand and manually check encoding, not as a substitute for a security review.
Yes — RSS and XML feeds commonly contain encoded ampersands, angle brackets, and quotes in text content. Paste the feed's text field here to decode it into normal readable text.
Encode the snippet here first, then place the encoded output inside a pre or code tag in your HTML. This ensures the browser displays the code as text rather than trying to interpret it as markup.