HTML encoder and decoder

Turn characters such as <, > and & into safe HTML entities, or decode entities like &amp; and &#233; back into readable text. Everything runs in your browser.

  • Free
  • No sign-up
  • Runs in your browser

Runs in your browser — your text is never sent to our servers.

How to use HTML Encoder and Decoder

  1. Choose Encode or Decode.
  2. Paste your text or HTML into the input box.
  3. When encoding, tick "Also encode non-ASCII characters" if you want letters like é and symbols like © written as entities.
  4. Copy the result or download it as a text file.

Features

  • Encodes & < > " ' as &amp; &lt; &gt; &quot; &#39;
  • Optional encoding of non-ASCII characters as named or hex entities
  • Decodes named, decimal (&#233;) and hex (&#xE9;) entities
  • Unknown named entities are left unchanged
  • Runs in your browser, so the text is never uploaded

Supported formats and limits

  • Maximum input: 10,000,000 characters

Examples

InputResult
<a href="/tienda?a=1&b=2">Café & té</a>&lt;a href=&quot;/tienda?a=1&amp;b=2&quot;&gt;Café &amp; té&lt;/a&gt;
café © 😀caf&eacute; &copy; &#x1F600; — Encode with non-ASCII characters on.
&lt;b&gt;Tom &amp; Jerry&lt;/b&gt; &eacute; &#233; &#xE9;<b>Tom & Jerry</b> é é é — Decode.

Limitations

  • Decoding knows the HTML 4 named entities (Latin-1 letters, Greek letters, arrows, common symbols). Other named entities are left as they are; decimal and hex entities always work.
  • Encoding protects text placed inside HTML content and quoted attributes. It is not a full defense against injection in every context, such as inside JavaScript or CSS.
  • Decoding does not check whether the result is safe to insert into a page.

Learn more

HTML gives a few characters special meaning: < starts a tag, & starts a character reference, and quotes delimit attribute values. To show those characters as text, or to put untrusted text into a page without it being read as markup, they are written as character references, also called entities.

An entity can be named, such as &amp; and &eacute;, or numeric, such as &#233; (decimal) and &#xE9; (hexadecimal). All three forms of é mean the same character. Named entities are easier to read, while numeric ones can express any Unicode character, including emoji.

Encoding is one of the basic defenses against cross-site scripting when text is placed in HTML content, but the right encoding depends on where the text goes: HTML body, attribute, JavaScript or URL each have their own rules. Use the encoder for HTML contexts, and the URL encoder for URLs.

Frequently asked questions

Which characters must be encoded in HTML?

At minimum & and <, because they start entities and tags. Inside attribute values you also need to encode the quote character used for the attribute; encoding > and both kinds of quotes is a safe habit.

What is the difference between &#233; and &#xE9;?

They are the same character, é, written with the decimal (233) or hexadecimal (E9) code point.

Why is &nbsp; decoded to an odd-looking space?

It becomes a no-break space (U+00A0), which looks like a normal space but is a different character that browsers do not collapse or wrap at.

Is my text uploaded?

No. Encoding and decoding run in your browser.

Sources

Last reviewed: September 30, 2026