HTML Entities Encoder / Decoder

Escape special characters as HTML entities (&, <, € …) or decode entities back to text – named, decimal or hexadecimal.

Runs locally in your browser
Encode

“HTML special characters only” escapes &, angle brackets and quotes. The other modes also convert all non-ASCII characters such as umlauts and emojis.

About this tool

In HTML some characters have a special meaning: < and > delimit tags, & starts a character reference and quotes enclose attribute values. If such a character should appear as text, it must be escaped – as an HTML entity like &lt; or &amp;. Otherwise it is interpreted as code, which can break pages or cause security holes (cross-site scripting).

This tool converts text to entities and entities back to readable text. Besides escaping the special characters, it can output all non-ASCII characters – accented letters, the euro sign, typographic quotes or emojis – as named (&ouml;), decimal (&#246;) or hexadecimal (&#xF6;) references. Both fields are editable.

For percent-encoding in addresses use the URL Encode / Decode, for Base64 the Base64 Encode / Decode converter.

How it works

  1. Paste text into the left field – it appears with entities on the right. Or paste code with entities on the right to decode it.
  2. Choose the mode: “HTML special characters only” for HTML-safe text, or “Named”, “Decimal” or “Hexadecimal” for pure ASCII output.
  3. Copy the result.

Frequently asked questions

Do I need entities for accented letters in HTML?

No, not if the page is served as UTF-8 – which is the standard today. Entities for accented letters are only needed when a system handles ASCII only, such as old e-mail templates or certain databases.

Which characters must always be escaped?

In text & and <, in attribute values also the quote you use. > and the other quote do no harm but are often escaped as well for consistency – this tool does the same.

What is &nbsp;?

A non-breaking space: it looks like a regular space but prevents a line break, e.g. between number and unit as in “5&nbsp;kg”.

Why are some entities not decoded?

The tool knows the common named entities from HTML 4 and all numeric references. Rare HTML5 names like &bigstar; stay unchanged. Numeric forms like &#9733; are always recognized.