HTML Entities Encoder/Decoder

Encode and decode HTML entities (named and numeric).

The HTML Entities tool encodes special characters into HTML entities and decodes entities back into plain characters. It can also convert every non-ASCII character to a numeric reference, and includes a searchable reference table of common named entities. Use it to safely show markup as text or to clean up escaped content.

What are HTML entities?

HTML entities are text sequences that stand for characters. They begin with an ampersand and end with a semicolon. A named entity such as & or © uses a name, while a numeric reference such as € or € uses the Unicode code point in decimal or hexadecimal. Entities exist because some characters have special meaning in HTML: less-than and ampersand can start a tag or another entity, and quotes end attribute values. Writing them as entities makes the browser show the character instead of interpreting it. Entities also let you write characters that are hard to type or that your file encoding cannot hold. Escaping text correctly is a basic defence against markup injection, but the right escaping depends on where the text is placed in the page.

How to use HTML Entities Encoder/Decoder

  1. Choose Encode or Decode Click Encode to escape characters or Decode to turn entities back into characters.
  2. Paste your text Paste the text into the Input box. The Output updates as you type.
  3. Set the options Tick Encode all non-ASCII characters and Use hex numeric references as needed.
  4. Look up an entity Use the Entity reference table below and type into Filter by name or character to find one.

Frequently asked questions

Why is the apostrophe encoded as '?

The numeric form works in every HTML version, while ' is not defined in HTML 4.

Does encoding make output safe from XSS?

Escaping these characters is the core of safe output for text nodes and quoted attributes, but safe output also depends on context, such as URLs, scripts and styles. Use your framework escaping where possible.

What is the difference between é and é?

They are the same character. The first uses the decimal code point and the second the hexadecimal one.

Which named entities are supported?

The common ones shown in the Entity reference table, including &, <, >, ", ©, € and many accented letters.

Is non-breaking space handled?

  is in the table and decodes to a no-break space character. It is shown as (nbsp) in the reference.

Is my text sent anywhere?

No. Encoding and decoding run in the page and the text is not sent to a server.