Toolvist

HTML Entity Encoder & Decoder

Encode or decode HTML entities — turn angle brackets, ampersands and quotes into safe entities, or convert them back. Free online HTML encoder.

Free HTML Entity Encoder & Decoder

The HTML Entity Encoder & Decoder converts characters to and from HTML entities. Encode special characters for safe display in markup, or decode entities back to characters.

The decoder side of this tool handles the reverse direction, and Strip HTML Tags removes markup entirely. To convert a document's format, the HTML Formatter & Beautifier is the companion.

How to use the HTML Entities

  1. 1 Paste your text or markup.
  2. 2 Choose encode or decode.
  3. 3 Pick whether to convert only the significant characters or every non-ASCII one.
  4. 4 Copy the result.

Where entities are genuinely needed

Entities are required when you need to display markup as text. Showing a literal `<div>` on a page means writing `&lt;div&gt;`, otherwise the browser treats it as a tag. That is the original purpose and still the main legitimate use.

Encoding everything else is mostly about avoiding ambiguity — a non-breaking space, a character that is visually similar to a normal space but behaves differently, or a symbol that is easy to mistype. Those are worth the entity form because their literal form is invisible or confusable.

  • `&amp;`, `&lt;` and `&gt;` are the strictly required ones.
  • Quote entities matter only inside attribute values.
  • Mojibake is an encoding problem, not an entity problem.
  • A non-breaking space is the entity you cannot type directly.

Frequently asked questions

Which characters actually need encoding?

In HTML content, only the ampersand, the less-than sign and the greater-than sign are strictly required, since they introduce markup. Quote characters matter inside attribute values. Everything else can be written literally. Encoding more than necessary is safe in content but makes the source harder to read.

What is the difference between a named and a numeric entity?

A named entity such as `&amp;` is readable and exists for the common characters. A numeric entity such as `&#38;` works for any character in the document's encoding, including ones with no name. For ASCII punctuation, named forms are clearer; for arbitrary Unicode, numeric is the only option.

When is encoding the wrong fix?

When the real problem is a character encoding mismatch. If text displays as mojibake — accented letters and punctuation replaced by unrelated symbols — the document is declaring one encoding and being served as another. Encoding every non-ASCII character will mask the symptom, but the correct fix is to declare UTF-8 and ensure the server sends it.

Related Developer Tools

Browse all Developer Tools →

You might also need

Tools from other categories that people pair with the HTML Entities:

Browse the full tool directory →