HTML Encoder / Decoder
Convert text to HTML entities and decode entities back to text.
Input
Output
What is the HTML Encoder / Decoder?
The HTML Encoder / Decoder converts text to HTML entities and back. Characters like <, >, &, " and ' have special meaning in HTML — displaying them literally requires entity encoding (<, >, &, ", '), and reading encoded content requires decoding.
Encoding user-supplied text before inserting it into HTML is a fundamental defense against cross-site scripting (XSS). This tool encodes with a strict character map and decodes using the browser's own parser in a detached document, so no markup is ever executed or injected into the page.
How to use the HTML Encoder / Decoder
- Paste text containing special characters (to encode) or entity-encoded text (to decode).
- Click Encode to escape HTML characters, or Decode to convert entities back to text.
- Copy the result for use in your templates or documentation.
Examples
Encode
<a href="x">Tom & Jerry</a> → <a href="x">Tom & Jerry</a>
Decode named and numeric entities
© 2026 — café → © 2026 — café
Frequently asked questions
Which characters does encoding escape?
The five HTML-significant characters: & < > " and '. That's sufficient to safely display any text inside HTML content or attribute values.
Does decoding execute the HTML?
No. Decoding parses the input in a detached, inert document — scripts never run and nothing is added to the page. Only the resulting plain text is returned.
Does the decoder support named entities like ©?
Yes. Because decoding uses the browser's real HTML parser, all named, decimal, and hexadecimal entities are supported.
Related developer tools
URL Encoder / Decoder
Percent-encode and decode URLs and query string components.
Security & Encoding
Base64 Encoder / Decoder
Encode and decode Base64 text with full UTF-8 support.
Security & Encoding
XML Formatter
Format, minify, and validate XML documents with pretty indentation.
Data & JSON
JWT Decoder
Decode JWT headers, payloads, and claims — entirely in your browser.
Security & Encoding