DevHive

HTML Entities Encoder / Decoder

Encode & decode HTML special characters

Common HTML Entities
&
Ampersand
&
<
Less than
<
&gt;
Greater than
>
&quot;
Double quote
"
&apos;
Apostrophe
'
&nbsp;
Non-breaking space
&copy;
Copyright
©
&reg;
Registered
®
&trade;
Trademark
&euro;
Euro
&pound;
Pound
£
&yen;
Yen
¥
&mdash;
Em dash
&ndash;
En dash
&hellip;
Ellipsis

How to Use HTML Entities Encoder / Decoder

  1. 1

    To encode: paste HTML or text containing special characters and click Encode.

  2. 2

    To decode: paste HTML with entities (like &amp; or &lt;) and click Decode.

  3. 3

    Copy the output to use in your HTML or template.

About HTML Entities Encoder / Decoder

Encode and decode HTML entities online. Convert special characters to HTML entities and back. Free online tool.

Best Use Cases

  • Encoding special characters for safe display in HTML pages
  • Decoding HTML entities in scraped web content to get plain text
  • Preparing user-generated content for safe HTML rendering
  • Converting special characters in XML or HTML data feeds
  • Encoding characters like < and > to prevent XSS in web applications

Examples

HTML safety

Encode <script>alert('hi')</script> to safely display it as text on a web page without executing.

Decode content

Paste HTML with entities like &amp;amp; and &amp;lt;. Decode to see the actual characters & and <.

Copy prep

Encode curly quotes, em dashes, and other special characters for clean HTML output.

Common Mistakes to Avoid

  • !Double-encoding entities so &amp; becomes &amp;amp;amp; in the output
  • !Only encoding angle brackets while missing ampersands and quotes
  • !Forgetting to encode content inside HTML attribute values, not just text nodes

Limitations

  • Only handles standard HTML named and numeric entities
  • Cannot encode or decode non-HTML character sets or custom entities
  • Does not detect or prevent XSS; only encodes individual characters

Frequently Asked Questions

Why encode HTML entities?

To prevent XSS attacks and ensure special characters like <, >, & display correctly in HTML without being interpreted as markup.