HTML Entity Encoder / Decoder
Encode special characters as HTML entities (such as amp, lt and copy) or decode named and numeric entities back to text. Live result, one-click copy.
Encode special characters as HTML entities (such as amp, lt and copy) or decode named and numeric entities back to text. Live result, one-click copy.
About this tool
This HTML entity encoder and decoder converts characters to and from the codes HTML uses to show them safely. In HTML, the less-than sign starts a tag and the ampersand starts an entity, so to show those characters as text — for example to display a code sample on a web page, or to put a quote mark inside an attribute — they must be written as entities. An entity is an ampersand, a name and a semicolon; on this page we write just the name, so lt means an ampersand, then lt, then a semicolon. The five core ones are lt (less-than), gt (greater-than), amp (ampersand), quot (double quote) and the numeric entity #39 (apostrophe). Choose Encode and paste your text: those five characters are converted, along with common symbols such as © (copy), ® (reg), ™ (trade), € (euro), £ (pound), ° (deg), × (times), ½ (frac12) and the non-breaking space (nbsp). Encode also converts ASCII punctuation such as ! # $ % * + , . / : ; = ? @ [ ] { } | ~ to their HTML5 names (excl, num, comma, period and so on). That makes the output very safe to paste anywhere in HTML, but longer; it is valid in HTML5 pages, though older HTML4 and XML parsers do not know those newer names. Letters, digits, accented letters and other Unicode characters are left unchanged, which is fine for any page saved as UTF-8. Choose Decode to go the other way. It turns every named entity HTML defines back into its character, including mdash, hellip and rsquo, and it decodes numeric entities in both forms, decimal (#8377 for ₹) and hexadecimal (#x20B9 for the same sign). A code that is not a real entity is left as it is. The result updates as you type and Copy puts it on your clipboard. Everything runs in your browser. A note on security: encoding the five core characters is what stops user-entered text from being run as HTML, but in real applications escaping should be done by your template engine or framework at output time, not by hand.

Pick the direction.
Code samples, quotes, symbols or encoded HTML.
It updates as you type.
Paste into your HTML, CMS or email template.
Ampersand, less-than, greater-than and both quote marks become amp, lt, gt, quot and #39.
©, ®, ™, €, £, °, ×, ½ and more as named entities.
Decimal (#8377) and hexadecimal (#x20B9) forms both turn into ₹.
Encoded punctuation cannot be mistaken for markup.
No button to press; the output follows your typing.
Runs in your browser.
Show characters, not markup
An HTML snippet in a blog post would otherwise render.
ExampleEncode a div tag so readers see the tag itself instead of a box.
Old systems and some email tools mangle raw symbols.
ExampleWrite the © in an email footer as the copy entity.
Exports and APIs often return quot and #39 entities.
ExampleDecode a product title from a feed back to “Men’s Shoes”.
A " inside an attribute value ends it early.
ExampleUse the quot entity for the inch sign in a 5-inch screen label.
Text saved through a CMS may be stored encoded.
ExampleDecode a CSV column of WordPress titles before analysis.
See exactly which characters need escaping.
ExampleEncode a paragraph and compare it with the original.
Escape the right amount
For text inside HTML, only the ampersand, less-than, greater-than and the two quote marks must be escaped. The extra punctuation names are optional.
An entity that starts with amp twice means the text was encoded twice. Decode until it reads normally, then encode once.
Decode leaves a code that is not a real entity as it is, so a typo is easy to spot in the result.
In a UTF-8 page you can type ₹, é or हिंदी directly; no entity needed.
For \u20B9 style escapes in JavaScript or JSON, use the Unicode converter.
Open Unicode ConverterSenior Software Engineer · Developer of Toolyconvert
Hemant developed HTML Entity Encoder / Decoder and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.
Last updated 24 November 2026
Featured on
Toolyconvert is listed on these product directories and launch platforms.