HTML Entity Encoder & Decoder
Encode text into HTML entities and decode entities back to text. Handles named (©), decimal (©), and hex (©) entities.
Paste text with <, >, &, or quotes and get safe HTML entities back — or paste entities and get readable text. The encoder covers the five markup-significant characters plus common typographic symbols (©, €, —, curly quotes), and the decoder understands named, decimal, and hexadecimal entities.
Encodes <, >, &, quotes and common symbols to named entities (apostrophe becomes ').
How to use this calculator
- Type or paste your text into the input box.
- Click Encode to convert special characters to entities, or Decode to reverse entities back to text.
- Use the Copy button to grab the result.
- Paste the output into your HTML page, CMS, or code sample.
Worked example
Encoding Tom & "Jerry" <cartoon> produces Tom & "Jerry" <cartoon> — verified by running the encoder. The browser now renders the literal characters instead of treating <cartoon> as an HTML tag.
Frequently Asked Questions
When do I need HTML entities?
Whenever you display reserved characters like <, >, or & in HTML without the browser interpreting them as markup. Typical cases: showing code samples on a page, rendering user-generated content safely, or pasting text into a CMS. Entities guarantee the character renders as literal text, never as an HTML tag.
What's the difference between named, decimal, and hex entities?
Named entities like © are readable mnemonics for common symbols. Decimal (©) and hex (©) entities reference the character's Unicode code point directly and can represent any character, including emoji. All three render identically in the browser — pick whichever is clearest for your situation.
Why does encoding < give &lt; instead of <?
Because the encoder replaces each source character exactly once. Your input < is four literal characters (&, l, t, ;), and only the & is special — so it becomes &lt;, which displays as the literal text "<". This is the correct, safe behavior: output always renders as the text you typed.
Which characters does the encoder handle?
The five markup-significant characters (& < > " ') plus common typographic symbols: © ® € £ ¥ ¢ § ¶ • – — ‘ ’ “ ” … and the non-breaking space. The apostrophe encodes as the numeric entity '. Everything else passes through unchanged.
Do I still need entities now that everything is UTF-8?
For <, >, and & — always. Those characters are structural to HTML regardless of charset, and leaving them raw breaks pages or opens XSS holes. For accented characters and symbols, UTF-8 pages can include them directly, but entities remain the safe choice when you're unsure of the page encoding or injecting text into attributes and scripts.