HTML ENCODER / DECODER

Convert special characters to HTML entities and back. Updates as you type. Nothing is uploaded.

75 chars
<h1 class="title">Hello & "World"</h1> <p>© 2024 — All rights reserved™</p>

Encode converts & < > " ' to HTML entities. Decode reverses named and numeric entities (&amp; © © etc).

How to encode or decode HTML entities

  1. 1

    Paste your text or HTML into the input box.

  2. 2

    The output updates live — switch between Encode and Decode modes.

  3. 3

    Encoding replaces <, >, &, ", and ' with their HTML entity equivalents.

  4. 4

    Decoding does the reverse, turning &amp;, &lt;, &gt;, and named/numeric entities back to characters.

Questions

What is HTML encoding?
HTML encoding converts special characters into entity references so they display correctly in a web page. For example, < becomes &lt; so the browser renders it as a less-than sign rather than interpreting it as a tag.
Which entities does the decoder support?
Named entities like &amp;, &lt;, &gt;, &quot;, &nbsp;, &copy;, &trade;, &euro;, &mdash;, and more, plus decimal (&#60;) and hexadecimal (&#x3C;) numeric character references.
Does encoding happen on a server?
No. All encoding and decoding is done with JavaScript running locally in your browser. Your text is never transmitted anywhere.
When would I use HTML encoding?
Use it when you need to safely embed user-supplied text in HTML (to prevent XSS), when writing HTML source examples in documentation, or when debugging entity issues in a web page's source.