RUNWEBTOOLS
English

HTML Encode / Decode

Encode or decode HTML entities.

Use on any page (bookmarklet)

Want HTML Encode / Decode without leaving the page you're on? Drag the button below to your bookmarks bar, then click it on any website to open HTML Encode / Decode right there — it runs entirely in your browser.

HTML Encode / Decode← drag this to your bookmarks bar

Use responsibly: a bookmarklet runs on whatever page you click it on. Avoid sensitive sites such as online banking, payment, or healthcare pages — you run it at your own risk. Everything is processed locally and no data is sent anywhere. See our Terms.

  1. Show your bookmarks bar if it's hidden — Ctrl+Shift+B (+Shift+B on Mac).
  2. Drag the button above onto the bookmarks bar.
  3. Open any website and click the bookmark — the HTML Encode / Decode panel appears in the top-right corner. Use ✛ to move it between corners, or ›/‹ to tuck it against the edge and pull it back out.
  4. Click the bookmark again (or the ✕) to close it.
Can't drag? Copy it and create a new bookmark with this as the URL:

Note: a few sites with strict security policies may block bookmarklets.

Examples

Encode special characters

Input

<p>Tom & Jerry</p>

Output

&lt;p&gt;Tom &amp; Jerry&lt;/p&gt;

Decode entities

Input

caf&eacute; &mdash; 5 &lt; 10

Output

café — 5 < 10

About this tool

This free online HTML encoder and decoder converts text to and from HTML entities. Encode to safely show <, >, and & on a web page, or decode entity-laden HTML back into readable text. An optional mode encodes every non-ASCII character as a numeric entity. Everything runs in your browser with no upload.

How to use

  1. Choose Encode or Decode.
  2. Paste your text or HTML (or click Sample to try it).
  3. Optionally turn on All non-ASCII when encoding.
  4. Copy the result, or use Swap to feed it back through the other direction.

Common uses

Displaying code examples in articles, sanitizing user input for safe rendering, fixing mojibake from scraped HTML, and preparing content for systems that require ASCII-only output.

Frequently asked questions

What are HTML entities?

HTML entities are codes like &amp;, &lt;, and &#169; that represent characters which would otherwise have special meaning in HTML or can't be typed directly. Encoding turns characters into entities; decoding turns them back.

Is this HTML encoder/decoder free?

Yes — it's a completely free online HTML entity encoder and decoder with no sign-up and no limits.

Which characters does it escape?

By default it escapes the five characters that matter for safe HTML: & < > " and '. Turn on 'All non-ASCII' to also encode accented letters, symbols, and emoji as numeric entities.

Does it decode named and numeric entities?

Yes. Decoding handles numeric entities like &#160; and &#xA0; plus common named entities such as &nbsp;, &copy;, &mdash;, and &euro;.

Is my text uploaded anywhere?

No. Encoding and decoding run entirely in your browser with no upload, so your content never leaves your device.

Why would I encode HTML?

To safely display code snippets or user input on a web page without breaking the markup or opening an XSS hole — escaping & < > prevents the browser from treating your text as tags.

Learn more

Related tools