HTML Encode / Decode

Escape text into HTML entities or decode entities back to plain characters.

Output

Why encode HTML?

Certain characters are meaningful to a browser: < starts a tag, & starts an entity. If you want to display those characters as text β€” in a code sample or a comment field β€” you must replace them with entities such as &lt; and &amp;. Correct encoding is also a core defence against cross-site scripting.

What this tool converts

Encoding escapes the five significant characters & < > " '. Decoding reverses named entities and numeric ones β€” both decimal like &#169; and hex like &#xA9; β€” using an explicit lookup, so nothing from your input is ever inserted into the live page.

How to use the HTML Encode / Decode

  1. Choose a mode. Pick Encode to create entities, or Decode to expand them.
  2. Enter your input. Paste the text or the entity-laden markup.
  3. Click Convert. The output also refreshes live as you type.
  4. Copy the result. Use the Copy button to reuse the output.

Frequently asked questions

Which characters get encoded?

The five that matter for safe HTML: & becomes &amp;, < becomes &lt;, > becomes &gt;, " becomes &quot; and ' becomes &#39;.

Does decoding run my HTML?

No. Decoding uses an explicit character map and numeric parsing, never innerHTML, so no markup or script is ever executed.

Does it handle numeric entities?

Yes. Both decimal (&#169;) and hexadecimal (&#xA9;) numeric references are decoded to their characters.

Is my text uploaded?

No. Encoding and decoding happen locally in your browser.