How to encode or decode HTML entities
- Paste text or HTML into the input box.
- 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 (é) or numeric (é) entities. - Press Decode to turn entities such as
&,’or back into normal characters. All of the 2,000+ entities defined by HTML5 are recognised. - 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 and a normal space?
A non-breaking space ( ) 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 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.