HTML Entity Encoder

Encode and decode HTML entities, with a symbol reference

Entity reference

How to encode or decode HTML entities

  1. Paste text or HTML into the input box.
  2. Press Encode to escape it for safe display in HTML. By default only the five special characters < > & " ' are escaped; choose a stronger level to also convert accented letters, symbols and emoji into named (&eacute;) or numeric (&#233;) entities.
  3. Press Decode to turn entities such as &amp;, &#8217; or &nbsp; back into normal characters. All of the 2,000+ entities defined by HTML5 are recognised.
  4. Search the reference table for a symbol and click an entity to copy it.

When do you need HTML entities?

Characters such as < and & have special meaning in HTML. To show them as text, for example when publishing a code sample in a blog post, they must be escaped, otherwise the browser treats them as markup. Escaping user input in the same way is the basic defence against cross-site scripting (XSS).

Named entities for accented letters and symbols were essential before UTF-8 became universal. Today you can usually type é or € directly as long as your page declares <meta charset="utf-8">. Entities remain useful for invisible characters such as the non-breaking space and the soft hyphen, for emails and systems that mangle non-ASCII text, and for XML feeds.

Privacy

Encoding and decoding run in your browser. Nothing you paste is uploaded or stored on a server.

What is the difference between &nbsp; and a normal space?

A non-breaking space (&nbsp;) looks the same but stops a line break at that point and is not collapsed with other spaces. Use it between a number and its unit, like 10&nbsp;kg.

Should I use named or numeric entities?

Both work in HTML. Numeric entities work for every Unicode character and in XML, while named ones are easier to read but exist only for a limited set.

Does decoding run scripts in my input?

No. Decoding uses a detached textarea element, which converts entities to text without executing any HTML or scripts.

Made by BufferMint. We also design and build software products for founders. See our services →

Your files and inputs never leave your device; we only count anonymous visits.