URL & HTML Encoder / Decoder

Percent-encode URLs and escape HTML entities.

Result
price%20%3D%20%E2%82%B9100%20%26%20tax%20%3C18%25%3E

URL encoding uses encodeURIComponent, which is meant for a single value (such as a query parameter), not a whole address.

About this tool

Special characters need protection when they travel inside a web address or a web page. In a URL, spaces, ampersands and non-English letters must be written as percent codes such as %20, otherwise the address can break or mean something else. In HTML, the symbols less-than, greater-than, ampersand and quotes must be written as entities such as < and & so the browser shows them as text instead of treating them as markup. This tool does both jobs in both directions. Choose URL encode or URL decode for values such as query parameters, and HTML escape or HTML unescape for text that goes into a page. Decoding reports a clear error for invalid percent sequences instead of failing silently, and unescaping understands named entities such as & and numeric ones such as ₹ for the rupee sign. Everything runs in your browser. HTML escaping is one safeguard, not a complete defence against injection attacks.

How to use it

  1. Choose URL encode, URL decode, HTML escape or HTML unescape.
  2. Type or paste your text in the input box.
  3. Read the result in the panel below.
  4. If decoding fails, check for a stray percent sign.
  5. Copy the result with the copy icon.

How it works

URL encode uses encodeURIComponent, which converts each character that is not a letter, digit or one of - _ . ! ~ * ' ( ) into percent codes of its UTF-8 bytes. URL decode reverses it. HTML escape replaces & < > " and ' with &amp; &lt; &gt; &quot; and &#39;. HTML unescape converts named entities from a small set and numeric entities in decimal or hexadecimal.

Example: The text price = ₹100 & tax encodes for a URL as price%20%3D%20%E2%82%B9100%20%26%20tax. The HTML-escaped form of <b>Tom & Jerry</b> is &lt;b&gt;Tom &amp; Jerry&lt;/b&gt;.

Common uses

  • Building a query string value that contains spaces, symbols or Hindi text.
  • Showing a code snippet on a web page without the browser running it as HTML.
  • Reading a percent-encoded link someone shared with you.

Frequently asked questions

Should I encode a whole URL with this?
Usually no. Encoding a whole address would also encode the slashes and colons. Encode each value, such as a query parameter, and join them yourself.
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent, which this tool uses, also encodes characters such as & and =, which makes it right for single values.
Does HTML escaping stop all attacks?
No. It is one safeguard for text placed between tags. Attributes, scripts and styles need their own handling.
Which named entities can it unescape?
A small common set such as &amp;, &lt;, &gt;, &quot;, &apos;, &nbsp;, &copy; and &reg;, plus all numeric entities.
Is my text sent anywhere?
No. Encoding and decoding happen in your browser.

Last reviewed 2026-11-01. Browse all tools