HTML Entity Encoder / Decoder
Convert characters to HTML entities (amp, lt, gt, quot, #39 and numeric #xNN) and back, with a per-character mapping table.
| Character | Entity |
|---|---|
| < | < |
| " | " |
| " | " |
| > | > |
| & | & |
| " | " |
| ’ | ’ |
| < | < |
| > | > |
| " | " |
| < | < |
| > | > |
What is it
Inside HTML, a handful of characters have reserved jobs: < and > open tags, & starts an entity, quotes delimit attributes. To show them as plain text you write entities instead: & becomes &, < becomes <, > becomes >, " becomes ", apostrophe becomes '. Non-Latin characters can also be written as numeric entities like 中. This tool converts both ways and shows exactly which character became what.
Notes & fun facts
The classic bug: you write <span> inside a blog post and the browser swallows half the paragraph because it thinks the < opened a tag. The fix is replacing it with <. Fun fact: browsers are forgiving and often render a bare & followed by letters anyway, but as soon as you have a string like © or in your text, the entity engine kicks in and surprises you.
Origin & history
Character entity references came from SGML in the 1980s and were carried into HTML 2.0 (RFC 1866, 1995), which defined the core set such as amp, lt and gt. HTML 3.2 (1997) and HTML 4.0 (1999) expanded the named list, and today HTML5 defines over 200 named entities — everything from © to &emoji; no, not really the emoji, but close.
