Skip to main content
Preparing workspace

URL Escape / Unescape

Escape or unescape URL text with encodeURIComponent, encodeURI, strict RFC 3986 or legacy escape()/unescape(), and compare every output side by side.

Still loading. If the tool doesn’t appear, reload this page.

Part of URL Encoder Decoder Tool

All 2 modes in URL Encoder Decoder Tool

About this tool

URL Escape / Unescape

Escape and unescape URL text with encodeURIComponent, encodeURI, RFC 3986 or legacy escape()/unescape(), compared side by side.

To escape a URL value in JavaScript use encodeURIComponent(), and to unescape it use decodeURIComponent(). The older escape() and unescape() are deprecated: escape() turns é into %E9 and € into %u20AC instead of the UTF-8 %C3%A9 and %E2%82%AC. Paste text here to run every function side by side, in both directions.

How to use URL Escape / Unescape

  1. Choose Escape or Unescape, then paste your text or encoded URL into the box.

  2. Pick the Encoding rules — Component (encodeURIComponent), Strict RFC 3986, Whole URL (encodeURI), Form body or Legacy JavaScript escape() / unescape().

  3. Read the output and the panel that runs your text through every JavaScript function side by side, then click Copy result (or Swap to run it back the other way).

Why use URL Escape / Unescape

  • Five rule sets, one box

    Component (encodeURIComponent), strict RFC 3986, whole-URL (encodeURI), x-www-form-urlencoded and legacy escape()/unescape() — pick the one that matches the system you are sending to instead of guessing.

  • Double-encoding and broken escapes caught

    Unescape mode reports "Yes — decode again" when it finds %25 followed by two hex digits, and names the 1-based position of any % that is not followed by two hex digits.

  • Whole URLs unpacked

    Paste a full URL and see its scheme, host and path alongside a table of every query parameter with both its raw and its decoded value.

  • Nothing leaves the page

    Encoding, decoding and URL parsing are all JavaScript string operations in your browser — no upload, no account, no usage limit, with a 100,000-character cap per input so a pasted document cannot freeze the tab.

Common use cases

  • Encode a redirect_uri or return URL before nesting it inside another link's query string, so its ? and & do not break the outer URL
  • Work out why a UTM value arrives as caf%25C3%25A9 instead of café — the double-encoding case the decoder flags for you
  • Escape a parameter for an OAuth 1.0a or AWS SigV4 signature base string, where ! ' ( ) and * must be percent-encoded
  • Read an old cookie, log line or legacy API value full of %u20AC-style escapes that decodeURIComponent() refuses, by switching to the legacy unescape() mode

Frequently asked questions

What is the difference between escape() and encodeURIComponent()?

escape() works on UTF-16 code units: characters up to U+00FF become %XX using their Latin-1 value (é → %E9) and anything higher becomes %uXXXX (€ → %u20AC). encodeURIComponent() writes UTF-8 bytes (é → %C3%A9, € → %E2%82%AC), which is what URLs and servers expect. escape() also leaves + / and @ untouched, while encodeURIComponent() escapes them.

Link to answer
Is escape() deprecated, and what should I use instead of unescape()?

Yes. escape() and unescape() are legacy functions kept only for old code. Use encodeURIComponent() and decodeURIComponent() for a single value or path segment, and encodeURI() and decodeURI() for a whole URL. The one case for unescape() is reading old data that contains %uXXXX escapes, which decodeURIComponent() rejects with a URIError.

Link to answer
What does it mean to escape and unescape a URL?

Escaping (percent-encoding) rewrites any character outside the RFC 3986 unreserved set — A-Z, a-z, 0-9, hyphen, period, underscore and tilde — as a % followed by two hex digits of its UTF-8 bytes, so a space becomes %20 and é becomes %C3%A9. Unescaping is the reverse: each %XX pair is turned back into the character it stands for. You escape data before it goes into a URL and unescape it when you read it back out.

Link to answer
What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes the delimiters ; / ? : @ & = + $ , and # along with spaces, so it is the right choice for a single query value or path segment — that is this page's Component mode. encodeURI leaves those eleven characters intact because it assumes you are passing a complete URL that still has to work, which is the Whole URL mode. Both functions escape [ and ]. Encoding a full URL with encodeURIComponent produces an unusable string; encoding a query value with encodeURI leaves & and = in place and breaks the parameter.

Link to answer
Why does encodeURIComponent leave ! ' ( ) and * unescaped?

Because those five characters counted as unreserved under the older RFC 2396 that JavaScript's function was written against, and RFC 3986 later dropped them from the unreserved set. Most servers cope, but signature schemes such as OAuth 1.0a and AWS SigV4 require them escaped — that is exactly what the Strict RFC 3986 mode here does, encoding each one to its UTF-8 bytes with uppercase hex.

Link to answer
When does a space become + instead of %20?

Only in application/x-www-form-urlencoded data — HTML form submissions and query strings built by URLSearchParams. Everywhere else in a URI, including the path and fragment, a space is %20 and a + is a literal plus sign. Use the Form body mode for form data; decoding a path with form rules would silently turn real plus signs into spaces.

Link to answer
What does %2520 mean in a URL?

It means the string was percent-encoded twice. A space becomes %20 on the first pass, then that % is itself escaped to %25 on the second, giving %2520. Unescape mode detects this pattern and shows "Yes — decode again": one pass gets you back to %20, a second pass gets you the original space.

Link to answer
Why does my URL fail to decode?

There are two causes and the tool names which one you hit. Either a % is not followed by two hex digits — the error points at the 1-based position of the bad escape, and a literal percent sign has to be written %25 — or the escapes are not valid UTF-8, for example a %C3 with no continuation byte after it.

Link to answer
Can I decode a whole URL and see its query parameters?

Yes. Paste any URL into either box and it is split with the RFC 3986 Appendix B reference expression into scheme, host, path, query and fragment, then each parameter is listed with its key, decoded value and raw form. Parameters are decoded with form rules, so a + inside a value reads as a space.

Link to answer
Is the URL escape / unescape tool free, and is my data uploaded?

Yes, it is free with no signup and no usage limit, and nothing you paste is uploaded. Every operation — escaping, unescaping and URL parsing — runs as JavaScript in your own browser with no server request; the only constraint is 100,000 characters per input.

Link to answer