Encode HTML entities
Escape & < > " ' for HTML, or every accent and symbol too, as named (é) or numeric (é) entities; decode them in one click.
Escape & < > " ' for HTML, or every accent and symbol too, as named (é) or numeric (é) entities; decode them in one click.
Runs entirely in your browser: nothing you type is sent or stored.
<script> would run in the browser of every visitor. This is cross-site scripting (XSS). Escaping turns < into <, so the browser shows the character instead of opening a tag.
{{ }}, PHP htmlspecialchars(). Escape by hand when you build HTML in a string, an e-mail, an RSS feed or a page that shows code.
| Character | Named | Numeric | Why |
|---|---|---|---|
& | & | & | |
< | < | < | |
> | > | > | |
" | " | " | |
' | ' | ' |
& and < are enough; in an attribute, the quote around its value must be escaped too, so always quote attributes. ' only exists since HTML5, so the tool writes ', understood everywhere. Escaping does not make a javascript: link safe, nor text placed inside a <script>. Check URLs, and encode their parameters.
é, are readable, but only some characters have one.é, work for any Unicode character, emoji included.é, use the code point as written in Unicode tables (U+00E9).<meta charset="utf-8">), can hold é, € or 👋 as they are: only the five special characters need escaping. Encode every character outside ASCII for channels limited to ASCII (some e-mail templates, old Latin-1 files), or to make invisible characters visible in the source.
| Entity | Character | Use |
|---|---|---|
| ||
­ | ||
© ® ™ | ||
€ £ ¥ | ||
– — | ||
… | ||
« » | ||
“ ” ‘ ’ | ||
× ÷ ± | ||
≤ ≥ ≠ ∞ | ||
← → ↑ ↓ | ||
° µ ¶ § |