Tools › Build › HTML Entities
🔣

HTML Entity Encoder & Decoder

Convert special characters to HTML entities for safe embedding in web pages — or decode entities back into readable text. Supports named, decimal and hex formats.

✅ 100% Private
⚡ Live Conversion
😀 Emoji-safe
&;

Convert

Type or paste text — it is encoded as you type.

📚

Common HTML entities

Click any entity to copy it.

No entities match your search.
Advertisement

💡 Why encode HTML entities?

Characters like <, >, & and " have special meaning in HTML. Writing them as entities (&lt;, &gt;, &amp;, &quot;) stops them from breaking your layout and is the first line of defence against cross-site scripting (XSS) when you display user-supplied text.

How to use

  1. Choose Encode → to turn special characters into entities, or ← Decode to turn entities back into text.
  2. Type or paste into the left box — the result updates as you type.
  3. For encoding, pick a format (named, decimal or hex) and tick “Encode all non-ASCII” if your page is not UTF-8.
  4. Click Copy output, or click any entity in the reference table to copy just that one.

What are HTML entities?

HTML entities are text codes that stand for characters. They start with & and end with ; — for example &lt; for <, &amp; for & and &copy; for ©. They come in three forms: named (&eacute;), decimal (&#233;) and hexadecimal (&#xE9;). All three display the same character.

When should you use them?

  • Showing code on a web page: escape <, > and & so the browser shows your code instead of running it.
  • Safe output of user input: escaping the five characters & < > " ' is the standard defence against XSS in HTML text and attribute values.
  • Special symbols: ©, ®, ™, €, ₹, arrows and maths symbols that are hard to type.
  • Invisible characters: &nbsp; keeps words together and stops spaces collapsing.
  • Old pages and emails: pages not saved as UTF-8 need non-ASCII characters written as entities.

Frequently asked questions

Which characters must always be encoded in HTML?

Four characters matter in HTML text: & → &amp;, < → &lt;, > → &gt;. Inside quoted attribute values you must also encode the quote you used: " → &quot; or ' → &#39;. This tool encodes all five by default.

What is the difference between named, decimal and hex entities?

They are three spellings of the same character. Named entities (&copy;) are easiest to read but only exist for about 2,000 characters. Decimal (&#169;) and hex (&#xA9;) work for every Unicode character, including emoji. If a character has no name, this tool falls back to the decimal or hex number.

Do I still need entities if my page is UTF-8?

Not for most symbols — UTF-8 can store © € ₹ and even emoji directly. You still need entities for < > & and quotes inside attributes, and for characters like the non-breaking space that are invisible or easy to confuse.

Does the tool handle emoji and other languages?

Yes. Text is processed by Unicode code point, so emoji and characters outside the basic range stay intact. With “Encode all non-ASCII” on, 😀 becomes &#128512; (or &#x1F600; in hex), and Hindi, Tamil, Chinese and Arabic text is converted character by character.

What does “Convert newlines to &lt;br&gt;” do?

HTML ignores ordinary line breaks. This option replaces each line break with <br> (and keeps a real line break after it) so the text keeps its lines when pasted into a web page.

Is it safe to paste private code here?

Yes. Conversion happens entirely in your browser; nothing is uploaded or stored.

Will decoding run any scripts in my text?

No. Decoding uses a harmless text container, so tags in your input are never executed or rendered — only the entities are converted.