URL Encoder & Decoder
Encode or decode URLs and query parameters. Supports encodeURI and encodeURIComponent.
Common Encodings
Why URLs Need Encoding
URLs can only contain a limited set of characters: letters, numbers, and a few special characters like hyphens and underscores. Everything else — spaces, ampersands, question marks, non-ASCII characters — must be "percent-encoded" to travel safely through browsers, servers, and APIs.
Percent-encoding replaces each unsafe character with a % followed by two hex digits. A space becomes %20. An ampersand becomes %26. The Japanese character "東" becomes %E6%9D%B1. It's the postal code of the web — ensuring your data arrives at the right destination without corruption.
This matters more than you think. A URL with an unencoded & in a query parameter can break the entire request. An unencoded space might silently truncate your data. URL encoding prevents these bugs before they happen.
Characters That Need Encoding
| Character | Encoded | Why It's Reserved |
|---|---|---|
| Space | %20 (or +) | Separates URL segments |
| & | %26 | Separates query parameters |
| = | %3D | Separates key from value in params |
| ? | %3F | Marks start of query string |
| # | %23 | Marks fragment/anchor |
| / | %2F | Separates path segments |
| @ | %40 | Used in email/authentication URLs |
| + | %2B | Interpreted as space in form data |
What this means for you: If you're building URLs dynamically (API calls, redirects, tracking links), always encode parameter values. Most programming languages have built-in functions: encodeURIComponent() in JS, urllib.parse.quote() in Python, URLEncoder.encode() in Java.
encodeURI vs encodeURIComponent
encodeURI()
Encodes a full URL but leaves reserved characters (: / ? # @ & = +) intact. Use it when you have a complete URL with spaces or non-ASCII characters in the path.
encodeURIComponent()
Encodes everything except letters, digits, and - _ . ~. Use it for individual query parameter values. This is what you need 90% of the time.
Common Encoding Mistakes
Double encoding
Encoding an already-encoded string turns %20 into %2520. This happens when a framework auto-encodes and you've already encoded manually. Decode first, or let only one layer handle encoding.
Encoding the full URL instead of just the value
Using encodeURIComponent() on an entire URL turns the :// into %3A%2F%2F, breaking the link. Use encodeURI() for full URLs, encodeURIComponent() for individual parameter values only.
Space as + vs %20
HTML forms encode spaces as +, but URLs use %20. If you're building a URL from form data, replace + with %20. Most modern APIs expect %20, but some legacy systems still expect +.
Related Tools
How to use this tool
Paste a URL or encoded string
Choose Encode (Component or URI) or Decode
Copy the result
Common uses
- Encoding query parameter values for API calls
- Decoding percent-encoded URLs for debugging
- Preparing redirect URLs with special characters
- Encoding form data for POST requests
- Making URLs safe for sharing and bookmarking
Share this tool