URL Encoder & Decoder

Percent-encode or decode text for URLs, and split any link into its protocol, host, path, hash and query parameters.

Runs in your browser – nothing you type is sent anywhere.

This free URL encoder and decoder converts spaces, symbols and non-English text into the %XX form that web addresses need, and back again. It can also take a long link apart so you can read every piece. It runs in your browser.

How to use the URL encoder

  1. Paste your text or link.
  2. Choose Component to encode a single value, such as a search term or one query parameter. This uses encodeURIComponent.
  3. Choose Full URL to encode a complete address while keeping its :, /, ?, & and # intact. This uses encodeURI.
  4. Press Encode or Decode.
  5. Paste a full URL to see its parts (protocol, host, path and hash) and a table of its query parameters.

What percent-encoding does

A URL may only contain a limited set of characters. Everything else is written as its UTF-8 bytes, each shown as % plus two hex digits. A space becomes %20, & becomes %26, and the rupee sign ₹, which takes three bytes in UTF-8, becomes %E2%82%B9. Decoding simply reverses this.

You meet encoded URLs all the time: when you search for filter coffee near me, share a Google Maps link, or open a link in an email campaign with tracking codes. Pasting such a link into the URL encoder and pressing Decode turns %20 and friends back into readable text, so you can see what the link really contains before you share it.

Component or full URL?

This is the choice that causes most bugs. Characters such as &, =, ? and / have a job inside a URL. Whether they should be encoded depends on whether you are encoding one value or the whole address. MDN’s pages on encodeURIComponent() and encodeURI() list the exact characters each one leaves alone.

InputComponent (encodeURIComponent)Full URL (encodeURI)
idli & vada = ₹60idli%20%26%20vada%20%3D%20%E2%82%B960Keeps & and =, which would break a query value
https://example.com/a?b=chttps%3A%2F%2Fexample.com%2Fa%3Fb%3Dchttps://example.com/a?b=c (unchanged)

The rule of thumb: encode each value with Component, then join the values into the URL. Use Full URL only for an address that is already correctly built but contains spaces or non-English characters. Never run Component on a whole URL, because it would encode the :// and slashes too.

const dish = 'idli & vada';
const url = 'https://example.com/menu?item=' + encodeURIComponent(dish);
console.log(url); // https://example.com/menu?item=idli%20%26%20vada

Reading the parts of a URL

Long links from shopping sites and ads are hard to read. The URL encoder’s breakdown splits them up. For https://shop.example.com/search/sarees?colour=red&city=Kanchipuram&q=silk%20saree#reviews you get:

PartValue
Protocolhttps:
Hostshop.example.com
Path/search/sarees
Query parameterscolour = red, city = Kanchipuram, q = silk saree
Hash#reviews

Tip: In HTML form submissions, a space in a query value is often sent as + instead of %20. decodeURIComponent() does not turn + back into a space, but the browser’s URLSearchParams does. Our lesson on PHP forms with GET and POST shows how query strings are sent.

To learn how links and requests work, see the HTML links and JavaScript fetch lessons.

Learn more

Frequently asked questions

Why do I get an error when decoding?

A % must be followed by two hex digits that form valid UTF-8. Text like 100% or a half-copied link makes decoding fail. Check for a stray % sign or a cut-off code.

Is URL encoding the same as encryption?

No. It only changes how characters are written so they can travel in a URL. Anyone can decode it, so never put passwords in a URL.

Should I encode letters and numbers?

No. Letters A–Z and a–z, digits and a few marks such as -, _, . and ~ are always safe and stay as they are.

Is my text sent anywhere?

No. Encoding, decoding and the URL breakdown all run in your browser.

More free tools

All tools

Image Compressor

Shrink JPG, PNG and WebP images in your browser. Up to 20 at a time, nothing uploaded.

Image Resizer

Resize a JPG, PNG or WebP image by pixels or percentage, with an aspect-ratio lock. Runs in your browser.

PDF Compressor

Make scanned and image-heavy PDFs smaller, right in your browser. Three levels, nothing uploaded.