How to use the html entity encoder and decoder
- Choose the direction with the buttons above the result.
- Type or paste your text in the top box.
- Copy the converted result.
Why escape HTML?
In HTML, < and > mark the start and end of tags and & starts an entity. To show those characters as text, for example when displaying a code sample on a web page, they must be replaced with entities, or the browser will try to interpret them. Escaping is also the basic defense against cross-site scripting (XSS) when inserting user-supplied text into a page.
The five that matter
| Character | Entity | Name |
|---|---|---|
< | < | less than |
> | > | greater than |
& | & | ampersand |
" | " | double quote |
' | ' | apostrophe |
Tick Also encode accented and special characters to convert everything outside basic ASCII, such as é, ©, € and “curly quotes”, into numeric entities like é. That is only needed for old systems that cannot handle UTF-8.
Decoding
The decoder understands named entities ( , ©, €), decimal entities (©) and hexadecimal ones (©). Tags in the input are left as text and never executed.