HTML Entity Encoder and Decoder

Encode and decode HTML entities online to escape special characters safely — free tool.

Options

About

About the HTML Entity Encoder and Decoder

Escapes the characters unsafe for HTML into named entities, or decodes entities back into plain characters.

Developers use it to make sure user-submitted text doesn't accidentally break page markup or open an XSS hole, while content editors use it to clean up text copied from a CMS that's full of stray entities like & and  . It's one of Toolapt's free data tools — no account needed, and no cap on how many times you use it.

Choose what to view about this tool

Guide

Using the HTML Entity Encoder and Decoder

  1. 1

    Step 1

    Paste your text or HTML into the Input box.

  2. 2

    Step 2

    Turn on "Encode all non-ASCII characters too" if you need every non-ASCII character escaped as well.

  3. 3

    Step 3

    Click "Encode" to escape it, or "Decode" to turn entities back into characters.

  4. 4

    Step 4

    Click "Copy" to copy the result, or "Clear" to start over.

  • Encodes the five HTML-unsafe characters: & < > " '
  • Optional mode encodes every non-ASCII character into a numeric entity
  • Decodes named and numeric HTML entities back to plain characters
  • Detects when there was nothing to decode, so you're not left guessing
  • One click to copy the result
  • Works entirely in your browser — nothing you paste is sent to a server
  • Free to use, with no sign-up and no limit on how many times you run it

Developers

Developers use the HTML entity tool for escaping user-submitted text before inserting it into a page, to avoid breaking markup or opening an XSS hole.

Content editors

Content editors use the HTML entity tool for cleaning up text copied from a CMS or email that's full of stray entities like &amp;amp; or &amp;nbsp;.

QA engineers

QA engineers use the HTML entity tool for preparing edge-case text — quotes, ampersands, angle brackets — to test how a form or page handles it.

Students learning HTML

Students learning HTML use the HTML entity tool for seeing exactly which characters need escaping and what their entity form looks like.

Examples

HTML Entity Encoder and Decoder examples

3 worked examples

01

Encoding unsafe characters

Encode "Tom & Jerry's \"show\"" to get "Tom &amp; Jerry&#39;s &quot;show&quot;", with all 5 HTML-unsafe characters escaped.

02

Decoding named entities

Decode "Caf&eacute; &amp; Bar" to get back "Café & Bar", with both the named and numeric entities resolved.

03

Non-ASCII mode switched on

With "Encode all non-ASCII characters too" turned on, encoding "Café" produces "Caf&#233;" — the é is converted into a numeric entity as well.

FAQ

Frequently asked questions

Quick answers to common questions about the HTML Entity Encoder and Decoder.

What does the HTML entity encoder and decoder do?

It escapes text so it's safe to place inside HTML, or reverses HTML entities back into plain characters.

Is this tool free to use?

Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.

Is my text safe when I use this tool?

Yes. Encoding and decoding happen entirely on your own device — nothing you paste is sent to a server.

Which characters get encoded by default?

The five characters that have special meaning in HTML: & becomes &amp;, < becomes &lt;, > becomes &gt;, " becomes &quot;, and ' becomes &#39;.

What does "Encode all non-ASCII characters too" do?

It additionally converts every character above the basic ASCII range (accented letters, symbols, emoji, and so on) into a numeric entity like &amp;#233; , which is useful when a downstream system only handles plain ASCII text reliably.

How does decoding work?

The tool lets the browser's own HTML parser interpret the entities and reads back the resulting text, so both named entities (like &amp;) and numeric entities (like &#39;) are handled correctly.

Can I use this tool on my phone?

Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.

Does this tool have any limitations?

It's built for typical text and markup snippets. There's no artificial length limit, though very large inputs may take a moment longer.

Still have a question? Contact us

Report a problem

HTML Entity Encoder and Decoder

What went wrong?
    or paste a screenshot