Skip to content
MySafeToolbox

HTML Entity Encode & Decode

Free HTML entity encoder and decoder. Escape & < > " ' or all non-ASCII to named, decimal or hex entities, and decode any HTML5 entity. Private, in-browser.

  • No upload — 100% private
  • Instant, on your device
  • Free, no sign-up
  • Works offline once loaded

How it works

How to use HTML Entity Encode & Decode

  1. Choose Encode or Decode.

  2. To encode, pick whether to escape only & < > " ' or every non-ASCII character too, and whether to use named, decimal or hex entities.

  3. Type or paste your text — the result updates as you type.

  4. Copy the result, or press Swap to send it back the other way and check the round trip.

Why use it

Why use our HTML Entity Encode & Decode tool

Safe escaping for HTML

Escapes the five characters that can break markup or open XSS holes: ampersand, less-than, greater-than and both quotes.

Named, decimal or hex

Output &eacute;, &#233; or &#xE9; — named entities fall back to numeric for characters that have no name.

Every HTML5 entity

Decodes all 2,000+ HTML5 named entities such as &check; and &nbsp;, plus decimal and hex references to any code point.

Emoji-aware

Characters outside the Basic Multilingual Plane, like 😀, become one &#128512; entity instead of two broken halves.

Browser-exact rules

Single-pass decoding (&amp;lt; stays &lt;), Windows-1252 fixes for &#150;-style references and U+FFFD for invalid ones.

Private by design

Everything runs in your browser — paste templates, emails or customer data without anything being uploaded.

FAQ

Frequently asked questions

What are HTML entities?

HTML entities are codes that start with & and end with ; and stand for a character, such as &lt; for < or &copy; for ©. They let you show characters that would otherwise be read as markup, or that are hard to type.

Which characters must be escaped in HTML?

In text and attribute values, escape & < > " and '. That is exactly what the default option does. Other characters only need encoding if your file can't be saved as UTF-8.

Should I use named or numeric entities?

Both work in every browser. Named entities like &eacute; are easier to read; numeric ones like &#233; exist for every Unicode character and also work in XML. The apostrophe is written as &#39; because &apos; is not part of HTML 4.

Why does &amp;lt; decode to &lt; and not <?

Decoding happens in a single pass, like a browser does: &amp; becomes & and the following lt; is plain text. Decode a second time if your text was double-encoded.

Does encoding HTML entities prevent XSS?

Escaping & < > " ' is the right defence for text placed inside HTML elements and quoted attributes. It is not enough inside <script> blocks, style attributes or URLs, which need context-specific encoding.

Is my text sent anywhere?

No. Encoding and decoding run entirely in your browser. Nothing is uploaded, logged or stored.