Skip to content
dashutils

HTML Entity Encoder & Decoder

Escape <, >, &, quotes and non-ASCII characters as HTML entities, or turn entities like &amp;amp; and &amp;#8212; back into text.

  • Free, no sign-up
  • Runs locally in your browser
Loading tool…

Your files are processed on this device and are never uploaded to a server.

How to use the HTML Entity Encoder & Decoder

  1. 1

    Paste or type your input.

  2. 2

    Choose the operation and options.

  3. 3

    Copy the output or download it as a file.

Why escape HTML

Escaping prevents text from being interpreted as markup, which is essential when showing user input or code samples in a web page.

Which characters must be escaped

Five characters can break HTML: < and > start and end tags, & starts an entity, and " and ' end attribute values. Writing them as &lt; &gt; &amp; &quot; and &#39; makes the browser show them as text. Escaping is the basic defence against cross-site scripting when you place user-supplied text into a page.

Named and numeric entities

Entities come in two forms. Named ones such as &copy; and &nbsp; are easier to read; numeric ones such as &#169; or &#xA9; work for every Unicode character. Modern pages saved as UTF-8 can include most characters directly, so you usually only need to escape the five special characters.

Frequently asked questions

Is my data sent to a server?

No. Everything runs in your browser as you type. Nothing is uploaded or logged, so it is safe to paste API responses, tokens and private text.

Why do I see &amp;amp; on my page?

The text was escaped twice. Decode it once here to get &amp;, which a browser displays as &.

Is escaping enough to stop XSS?

Escaping text placed between tags is the main step, but values inside attributes, URLs and scripts need context-specific handling too. Use your framework's built-in escaping where possible.

What is &nbsp;?

A non-breaking space: it looks like a normal space but stops the line from breaking at that point, for example between a number and its unit.

Something not working, or missing a setting you need? Report a problem or request a tool.