HTML Entities Encode / Decode

Escape < > & " for HTML, or turn &eacute; and &#169; back into text.

Result

&lt;a href=&quot;/?a=1&amp;b=2&quot;&gt;Café © 2026 — “quotes”&lt;/a&gt;
1 lines · 80 bytes

What are HTML entities?

An HTML entity is a code that stands for a character, written between an ampersand and a semicolon. For example, &lt; means the less-than sign, &amp; means an ampersand and &eacute; means é. Entities let you show characters that HTML would otherwise treat as part of its own markup.

The five characters that matter most are & < > and the two quote marks. If you put raw text containing them into a page, the browser may read them as code. Encoding turns them into entities so they display as plain text. Decoding does the opposite. This tool also supports named entities and numeric ones such as &#233; and &#xE9;.

How to use the HTML Entities Encode / Decode

  1. Paste your text into the box.
  2. Choose Encode or Decode.
  3. When encoding, pick how much to convert, from only the markup characters up to every non-ASCII character.
  4. Copy the result.

Real situations

When people use the HTML Entities Encode / Decode

  • 1

    Show code samples on a web page

    To display <div class="a"> as text in a tutorial, encode it first so the browser prints it instead of treating it as a tag.

  • 2

    Clean up text copied from a page source

    Decode strings full of &amp; and &quot; that came from HTML or an RSS feed so you can read them normally.

  • 3

    Write special symbols in plain ASCII files

    Turn © or é into &copy; or &eacute; when a template, email or older system cannot be trusted to keep UTF-8.

  • 4

    Reduce risk when printing user text

    Escaping text before placing it in a page is a standard defence against injected markup. Use it as a quick check on what a safe output looks like.

FAQ

HTML Entities Encode / Decode: questions answered

Which characters must be escaped in HTML?

Always the ampersand and the less-than sign. Inside an attribute value, also the quote character you used around it. The greater-than sign is escaped by convention. Everything else, including accented letters, can be written directly if the page uses UTF-8.

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

Both mean é. The first gives the Unicode number in decimal (233) and the second in hex (E9). Browsers treat them identically. Named entities such as &eacute; are easier to read but exist only for a fixed list of characters.

What does each Encode option do?

"Only & < > " and apostrophe" changes just the markup characters. The other options also convert non-ASCII characters to named, decimal or hex entities. For instance, Café © becomes Caf&eacute; &copy; in named mode and Caf&#233; &#169; in decimal mode.

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

Decoding runs once. The text &amp;lt; is an escaped ampersand followed by lt;, so one pass gives the characters &lt;. If you want the plain less-than sign, decode the result a second time.

Does encoding make user input safe against attacks?

Escaping is a key part of preventing cross-site scripting, but the right escape depends on where the text goes: HTML body, attribute, script or URL. Use your framework's built-in escaping in real code, and treat this tool as a way to check results.

Do I need entities if my page is UTF-8?

Usually not for letters and symbols. You can type é or © directly. You still need entities for the markup characters, and for the occasional invisible or ambiguous character that you want to make explicit.

Is this HTML Entities Encode / Decode free and private?

Yes. It is free with no sign-in, and every calculation runs inside your browser. Nothing you type is sent to a server or stored, and the page keeps working offline once it has loaded.

Private by design. No accounts, no cookies, no tracking. Everything you type stays on your device.

How we keep it that way