HTML Entity Text

Paste text to escape the characters HTML treats as markup, or decode named and numeric entities back to plain text — instantly, in either direction. One-click copy on the result.

100% client-side — text never leaves your browser Both directions Free · no signup

Text input

Every character HTML treats as markup — & < > " ' — is escaped so it displays literally.

Encoded output

Wrangling markup and snippets all day?

QADIR OS agents escape, sanitise and format the text, code and config flowing through your site and docs — automatically, on your own machine.

Join Early Access

Escape and unescape HTML, both ways

A handful of characters carry special meaning in HTML: the ampersand starts an entity, the angle brackets open and close tags, and quotes delimit attribute values. If you want to show those characters as themselves — a code snippet, a literal tag, a stray & in a headline — you have to replace them with escape codes called entities. This tool does that in one paste, and reverses it just as fast, turning &lt;div&gt; back into a real <div>.

Plain text
<a href="x?a=1&b=2">Tom & Jerry</a>
Encoded
&lt;a href=&quot;x?a=1&amp;b=2&quot;&gt;Tom &amp; Jerry&lt;/a&gt;

Which characters get escaped

By default the tool escapes the five characters that can break markup or open a security hole. Turn on Encode all non-ASCII to also convert accented letters, emoji and symbols into numeric entities — useful when a target system is limited to plain ASCII.

CharacterNamed entityNumericWhy escape it
&&amp;&#38;Starts every entity — escape first
<&lt;&#60;Opens an HTML tag
>&gt;&#62;Closes an HTML tag
"&quot;&#34;Ends a double-quoted attribute
'&#39;&#39;Ends a single-quoted attribute

Named vs numeric entities

The copyright sign can be written three ways that all render identically: &copy; (named), &#169; (decimal) or &#xA9; (hexadecimal). Named entities read better; numeric entities always work, even for characters with no name. Pick the style with the Entity style dropdown — the decoder understands all three regardless of which you chose.

When do I actually need this?

Any time text becomes part of a web page. Displaying code samples in a blog post, dropping user input into HTML without letting it run as markup (the root of many cross-site-scripting bugs), cleaning up entity-mangled text pasted out of a CMS, or debugging why &amp; keeps showing up on your page — all of these are one paste away here.

Does encoding change my text?

No. Encoding and decoding are exact inverses of each other, so a round trip returns your original text character-for-character. Entities are just a different spelling of the same characters — the meaning and the visible result never change.

Privacy

Everything runs in your browser as plain JavaScript. Your text is never uploaded, logged or stored on any server — refresh the page and it is gone. That makes it safe to paste private snippets, internal code, and confidential content.

More developer tools