HTML Entity Encode / Decode — Escape & Unescape HTML
HTML Entity Encode / Decode converts special characters like <, >, &, and quotes into safe HTML entities (and decodes them back). Use it when working with HTML attributes, templates, CMS editors, Markdown docs, or when debugging copy/paste issues. Handles common named entities (e.g. <, >, &, ") and numeric entities. Runs 100% locally in your browser — no uploads — and works offline after installing ToolMill as a PWA.
Encoding
Try it
Examples
<div>"x" & y</div>
<div>"x" & y</div>
<span title="Tom & Jerry">5 &lt; 10</span>
<span title="Tom & Jerry">5 < 10</span>
When to encode HTML entities
Use entity encoding when you want characters like angle brackets, ampersands, or quotes to display literally instead of being interpreted as markup. That is especially useful for tutorials, CMS fields, Markdown documents, code samples, copied snippets, and HTML attribute values.
What gets encoded
The most common cases are <, >, &, and quotes. Depending on the workflow, you may see named entities such as < and &, or numeric forms such as ' and '. Different editors may choose different forms while still rendering the same visible character.
Practical workflows
This page is useful when you want to display raw HTML source in documentation, clean up entity-filled text copied from a CMS or support system, decode already-escaped strings from exports, or verify whether a pasted snippet has been escaped once or multiple times before publishing it.
Avoid double-encoding
A common mistake is encoding text that already contains entities. For example, a plain ampersand becomes &, but an existing & encoded again becomes &amp;. If the pasted input already looks escaped, check it carefully before clicking Encode.
Context still matters
Entity encoding is useful for displaying literal markup and preventing accidental rendering in many content workflows, but it is not a complete substitute for context-aware escaping in every application. Decoded output can also become active markup again if you paste it into a live HTML editor or page builder.
Privacy and local processing
Before You Rely on Entity-Converted Text in Web Pages or Feeds
Before publishing or embedding the result, confirm the exact HTML context where it will be used and whether the destination system already performs escaping automatically. A correctly converted string can still be wrong if it is inserted into the wrong place or escaped twice.
Where HTML Entity Conversion Can Still Produce Unsafe or Unwanted Results
Entity conversion can help with display and escaping, but it does not guarantee safety in every context. Double-encoding, partial escaping, and mismatches between text content and attribute contexts can still leave output broken or misleading if the destination expects different handling.
How to Interpret Encoded and Decoded HTML Entity Output
Encoded output is intended to represent characters safely in HTML-related contexts, while decoded output restores the literal characters those entities represent. That does not automatically make the result appropriate for every place you might paste it, because HTML text nodes, attributes, scripts, and feeds can each have different escaping needs.
Because the conversion runs in your browser, you can inspect copied template fragments, CMS content, support messages, or partially escaped markup without sending that text to another site. That is practical when your snippets include internal content or drafts that should stay local.
Related tools
Base64 Encode / Decode Tool
Encode text into Base64 or decode Base64 back into readable content directly in your browser. It is useful for inspecting tokens, debugging authorization headers, checking config values, decoding API payloads, and converting plain text without using a remote service. ToolMill runs fully client-side for privacy and continues to work offline after installation.
Encoding
Hex Encode / Decode — Text ↔ Hex
Hex Encode / Decode converts text into hexadecimal (base-16) bytes and decodes hex back into readable text. Use it for debugging binary payloads, inspecting UTF-8 bytes, reversing escaped strings, and working with hashes or low-level protocols. Accepts common hex formats (with or without spaces, newlines, or 0x prefixes). Runs 100% locally in your browser — no uploads — and works offline after installing ToolMill as a PWA.
Encoding
ROT13 Encode / Decode — Text ↔ ROT13 Cipher
ROT13 is a simple letter substitution cipher that shifts A↔N, B↔O, etc. It is often used for spoilers, light obfuscation, and forum/email text. This tool encodes plain text to ROT13 and decodes ROT13 back to text (the operation is symmetric). Runs 100% locally in your browser — no uploads — and works offline after installing ToolMill as a PWA.
Encoding
URL Encode / Decode (Percent-Encoding)
URL Encode/Decode (percent-encoding) converts unsafe characters into a URL-safe format and back again. Use it for query strings, redirect URLs, UTM parameters, and debugging API requests (RFC 3986). Runs 100% locally in your browser — no uploads — and works offline after installing ToolMill as a PWA.
Encoding
