URL Encoder/Decoder

Spaces, ampersands, and non-ASCII break query strings. RFC 3986 percent-encoding (what encodeURIComponent does) turns those characters into %HH so a server can parse one parameter from the next. Encoding is not escaping for HTML and not a security boundary by itself.

What the URL encoder and decoder is for

URLs may only contain a limited set of characters. Spaces, ampersands, question marks, and non-English characters must be percent-encoded or they will break the link or silently change its meaning.

Getting this wrong causes real bugs: a query parameter containing an unencoded ampersand splits into two parameters, and a search term with a space truncates.

Common uses

  • Building a query string with user-supplied values
  • Debugging a redirect URL that arrives truncated
  • Reading an encoded callback or return-to parameter
  • Encoding non-English text for a link or API call

What the output means in the real world

The encoded string is what belongs after ? or inside a redirect target. Decode when you are reading a log line or a copied link and need the original path. Double-encoding (%253F) is a common bug and a common WAF bypass attempt; decode once and inspect, do not blindly decode in a loop.

How this fits into real work

Open-redirect and SSRF bugs often hide in a url= parameter that was encoded to look harmless. Decode it before you decide a ticket is clean. encodeURI and encodeURIComponent are not interchangeable; the former leaves :/?# intact.

Internationalised paths need UTF-8 then percent-encoding. Pasting a raw Unicode URL into an old tool can silently corrupt the path. This page shows the exact % sequences a browser would send.

Form bodies use application/x-www-form-urlencoded, which encodes spaces as + rather than %20. If a decoder turns pluses into spaces, you are in form-encoding, not path-encoding.

How to use this tool

  1. Paste the text or URL you want to convert.
  2. Press Encode to make a value safe for a URL, or Decode to read an encoded one.
  3. Encode individual parameter values rather than a whole URL, otherwise the :// and separators get encoded too.

Tips

  • A + in a query string means a space; in a path it is a literal plus. This inconsistency causes a surprising number of bugs.
  • Double encoding produces %2520 where you expected %20 — a sign a value was encoded twice along the way.
  • In JavaScript use encodeURIComponent() for values and encodeURI() for whole URLs.

Privacy & how it works

Everything happens inside your browser. The values you type are held in page memory only, are never sent to a server, and disappear when you close the tab. You can confirm this in your browser's network tab: the only request a tool makes is one that names the tool for a usage count, with nothing you typed in it. The tools also work with the internet disconnected.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI leaves URL structure characters like : / ? & alone, so it suits a complete URL. encodeURIComponent encodes them too, which is what you want for a single parameter value.
Why does a space become %20 sometimes and + at others?
%20 is standard percent-encoding. The + comes from the older form-encoding rules and is valid only in a query string, never in a path.

Browse other tools

All tools run entirely in your browser — nothing you type is sent to a server, except the optional HIBP 5-character hash prefix.