By ToolzHive · Updated
Use a semicolon and preserve case in named references. This shortlist covers frequently used characters; the WHATWG source contains the full registry.
Reference table
| Named reference | Character | Numeric reference |
|---|---|---|
| & | & | & |
| < | < | < |
| > | > | > |
| " | " | " |
| ' | ' | ' |
| | non-breaking space |   |
| © | © | © |
| ® | ® | ® |
| ™ | ™ | ™ |
| – | – | – |
| — | — | — |
| … | … | … |
| • | • | • |
| € | € | € |
| £ | £ | £ |
| ¥ | ¥ | ¥ |
| × | × | × |
| ÷ | ÷ | ÷ |
| ± | ± | ± |
| ° | ° | ° |
Copyable example
<a href="/?q=red&sort=name">Red & blue</a> Escape once
An ampersand may need & in HTML. Re-escaping an encoded value can produce &amp;. Keep original text separate from encoded output.
Context matters
HTML escaping does not make JavaScript, CSS or URLs safe. Use an escaping function appropriate to the destination.
Try the related tools
- HTML Entity Encoder / Decoder — Escape special characters to HTML entities and back.