HTML Entity Encoder & Decoder

Encode special characters as HTML entities or decode them to readable text. Convert named, decimal and hexadecimal references, with support for Unicode and emoji.

0 characters
Result

Your result will appear here.

How to encode or decode HTML entities

  1. Paste text or HTML character references and choose Encode or Decode.
  2. When encoding, enable named entities for forms such as &, or turn them off to use hexadecimal references.
  3. Run the conversion and copy or download the text. The result is displayed literally, not rendered as a webpage.

Working with HTML Entity Encoder & Decoder

Encoded text is useful when displaying angle brackets and other special characters as text. Decoding never executes the result here. HTML entity encoding is not a substitute for context-aware HTML sanitisation.

Example: display HTML markup as text

Input
<p title="A&B">Hello, world! ๐Ÿ‘‹</p>
Result
&lt;p title=&quot;A&amp;B&quot;&gt;Hello, world! &#x1F44B;&lt;/p&gt;

Questions about HTML Entity Encoder & Decoder

What is the difference between named and numeric HTML entities?

&copy;, &#169; and &#xA9; all represent ยฉ. Decoding accepts named, decimal and hexadecimal references. Encoding uses names where available when that option is enabled; other characters, including emoji, use numeric references.

Why does &lt; become &amp;lt;?

Encoding text that already contains entities encodes its ampersands again. Each decode operation removes one layer: &amp;lt; becomes &lt;, not <. Check the source before decoding repeatedly. &nbsp; represents a non-breaking space, not an ordinary space.

Is HTML entity encoding the same as URL encoding?

No. HTML uses references such as &amp;, while URL encoding uses percent escapes such as %26. Use the URL tool for parameter values. A URL inside an HTML attribute may need URL encoding for its values and HTML escaping for the attribute itself.

Does this tool clean HTML or prevent XSS?

No. It converts characters, not untrusted markup into safe HTML. Results are shown as text and never executed here. Production code needs protection appropriate to its HTML, URL, CSS or JavaScript context. Decoding rejects unknown entities, missing semicolons in references and invalid numeric references.

Are my files, tokens or text uploaded?

No. These tools process your input in your browser. The website serves the page and its code, but your input is not sent to a conversion server or saved in an account.

  • URL Encoder & Decoder

    Encode and decode URL components, complete URLs and form values. Handle percent escapes and spaces correctly.

  • Unicode Inspector & Escape Converter

    Inspect Unicode code points, UTF-8 bytes and UTF-16 units, or convert JavaScript Unicode escapes to readable text.

  • Text Diff Checker

    Compare two texts by line, word or character. Highlight additions and removals while retaining spaces and line breaks.

Explore all developer tools

Encoding & Files

Move between text, bytes, URLs and embedded images without changing your original data.

Data & Text Inspection

Read structured data, inspect tokens and understand exactly what changed.

Hashes, IDs & Schedules

Check file integrity, generate identifiers and make sense of times and recurring schedules.

Your input and files are processed on your device. Keep sensitive results out of shared clipboards and use a trusted device for private keys and tokens.