| Char | Named | Numeric |
|---|---|---|
| & | & | & |
| < | < | < |
| > | > | > |
| " | " | " |
| ' | ' | ' |
|   | |
| © | © | © |
| ® | ® | ® |
| ™ | ™ | ™ |
| € | € | € |
| £ | £ | £ |
| ¥ | ¥ | ¥ |
| — | — | — |
| – | – | – |
| … | … | … |
| « | « | « |
| » | » | » |
| ° | ° | ° |
| × | × | × |
| ÷ | ÷ | ÷ |
HTML Entity Encoder & Decoder — Free Online Tool
What are HTML entities?
HTML entities are escape sequences that represent characters with reserved meaning in HTML — <, >, &, and quote characters — or characters that can't be typed directly. Two forms exist: named entities like & and numeric entities like &. Encoding raw text before placing it inside HTML prevents the browser from interpreting it as markup, which is how most cross-site-scripting bugs get introduced.
How to use
- Pick Encode or Decode.
- In encode mode, toggle which characters to escape: Quotes, Apostrophe, Non-ASCII.
- Type or paste your text — conversion happens in real time.
- Use the reference table on the right to look up specific entities.
- Press Swap to round-trip the output back through the other direction.
Frequently Asked Questions
When should I encode HTML entities?
Encode any user-supplied content before inserting it into HTML — comment fields, post titles, product descriptions, anything coming from outside your code. Without encoding, raw < and > characters get parsed as HTML tags instead of shown as text, which is how cross-site scripting attacks slip in.
What's the difference between named and numeric entities?
&copy; and © both produce ©. Named entities are easier to read; numeric entities work in any HTML/XML context, including older specs that don't define the named version. For maximum compatibility — especially in XML — use numeric. For readability in HTML, use named.
Do I need to encode quotes and apostrophes?
Inside element content, no — < and > and & are the only characters that strictly need encoding. Inside attribute values, you must encode whichever quote character delimits the attribute. The Quotes and Apostrophe toggles let you be conservative when the encoded output will be inserted into HTML attributes.
What does the Non-ASCII option do?
It converts every character above code point 127 — accented letters, emoji, Chinese/Japanese characters, math symbols — into &#NNNN; numeric entities. Useful for plain ASCII transport or when the destination doesn't reliably handle UTF-8. Most modern HTML pages don't need this.
Does this tool send my data to a server?
No. Encoding and decoding run entirely in your browser using JavaScript. Your text never leaves your device.