Free HTML Entity Encoder & Decoder

Free HTML entity encoder and decoder. Escape characters or decode &, < and ₹ back to text. Named, decimal or hex output plus a reference chart.

  • No upload, 100% private
  • Instant, in your browser
  • 100% free, no signup
Loading tool…
Read the complete guideWhen to Use HTML Entities, and When Plain UTF-8 Is Better →

About the HTML Entity Encoder / Decoder tool

Characters like <, > and & have special meaning in HTML. If you paste them straight into a web page, a blog template or an email, the browser may treat them as code, break your layout or even open the door to script injection. Converting them into HTML entities such as &lt; and &amp; makes the text display exactly as typed. This HTML entity encoder does that conversion instantly, and the decoder turns entity-filled text back into readable characters.

You can choose how characters are written. Named entities like &copy; and &hellip; are easiest to read, decimal codes like &#169; work everywhere, and hex codes like &#xA9; are popular in XML and CSS work. An optional switch also encodes every non-ASCII character, such as ₹, é, Devanagari letters or emoji, which helps when an old system or database mangles UTF-8.

Decoding understands every entity defined in HTML5, not just the common ones. A searchable reference table of frequently used symbols sits below the tool, and clicking a row copies its code. All processing happens in your browser, so private snippets never leave your computer.

How to use HTML Entity Encoder / Decoder

  1. Choose “Encode” to turn text into entities, or “Decode” to turn entities back into text.
  2. Type or paste your content in the input box, or click “Sample” to try an example.
  3. When encoding, pick an entity format (Named, Decimal or Hex) and decide whether to also encode non-ASCII characters.
  4. Read the result on the right as you type and click “Copy” to copy it.
  5. Use “Swap” to feed the output back in and reverse the conversion, or click a row in the reference table to copy a single entity.

Features

Encode and decode in one place

Switch direction with a click, and swap output into input to test a round trip.

Named, decimal or hex output

Pick the entity style your template, CMS or XML file expects.

Full HTML5 decoding

Decodes all named entities including rarer ones like &rarr; and &hearts;, plus any numeric code.

Unicode aware

Emoji and characters outside the basic plane are encoded as a single correct code point, not broken halves.

Searchable entity reference

A table of common symbols, currency signs, arrows and maths characters with one-click copy.

When to use it

  • Show HTML or XML code examples inside a blog post without the browser rendering them.
  • Escape user-entered text before inserting it into an HTML template by hand.
  • Clean up product descriptions exported with &quot; and &#39; scattered through them.
  • Insert the ₹ symbol, © or ™ safely in an email template that only accepts ASCII.
  • Debug why an RSS feed or API response shows &amp;amp; instead of &amp;.

Frequently asked questions

Which characters must be encoded in HTML?

At minimum & and < in text, and the quote character used around an attribute value. Encoding >, " and ' as well is common practice and is what this tool does by default.

Should I use named or numeric entities?

Named entities are easier to read, but numeric ones work for every Unicode character and in XML where most HTML names are not defined. Both render identically in browsers.

Is there a named entity for the rupee symbol?

No. The Indian rupee sign ₹ has no named entity, so it is written as &#8377; or &#x20B9;. In named mode this tool automatically falls back to the numeric code.

Does encoding protect against XSS?

Encoding text before placing it inside HTML element content is a key part of preventing cross-site scripting, but different contexts such as JavaScript, URLs and CSS need their own escaping. Use your framework’s built-in escaping in production code.

Why does my text show &amp;amp; instead of &amp;?

That happens when text is encoded twice. Paste it into the decoder and run it once or twice until the plain characters appear.

Related tools