URL Encoder / Decoder
Percent-encode URLs and query strings, or decode them back to readable text.
Percent-encode and decode URLs safely
URLs have strict syntax rules, and a handful of characters — spaces, &, ?, #, =, non-ASCII — have special meaning. To include them safely in a URL, they must be percent-encoded. This tool encodes and decodes URLs using the same semantics as JavaScript’s encodeURIComponent / encodeURI / decodeURIComponent / decodeURI.
Which mode should you use?
Component mode (safe for single parameter values):
- Input:
hello world & friends - Output:
hello%20world%20%26%20friends
Full-URI mode (safe for complete URLs):
- Input:
https://example.com/path with spaces?x=1&y=2 - Output:
https://example.com/path%20with%20spaces?x=1&y=2
Notice that ?, &, =, / and : are left alone in full-URI mode because they are structural.
Common mistakes
- Double-encoding. Running
encodeon an already-encoded URL turns%20into%2520. If your decoder output still looks encoded, decode it a second time — and then ask where the double-encoding originated. - Encoding the whole URL with component mode. This breaks the URL by encoding the protocol colon and slashes. Use full-URI mode for complete URLs and component mode only for individual query-parameter values.
- Not encoding
+in form data. If you are targeting a form-encoded endpoint, encode+as%2B.
Frequently asked questions
- What is the difference between component and full-URI encoding?
- Component encoding (`encodeURIComponent`) is strict — it escapes every character that has special meaning in a URL, so it is safe for individual query-parameter values. Full-URI encoding (`encodeURI`) leaves reserved characters like `/`, `?`, `#`, `&` alone because they are expected in a complete URL.
- Why does decoding sometimes fail?
- URLs that were not produced by a percent-encoder can contain bare `%` signs that are not the start of a valid escape. The decoder throws an error when it hits such a sequence rather than silently returning wrong data.
- Should I encode the "+" sign?
- The `+` sign is reserved in the application/x-www-form-urlencoded format, where it means "space". In component mode, `+` is encoded to `%2B` to avoid ambiguity.