URL Encoder / Decoder
About this tool
A URL encoder converts characters that are unsafe inside a URL — spaces, &, =, ?, /, non-ASCII, and many more — into %xx percent-encoded escapes. Without encoding, a query parameter containing a space or ampersand would corrupt the URL structure. Web frameworks usually do this for you, but you need it manually any time you build a URL by string concatenation.
How to use
- Choose Encode to escape characters, or Decode to recover the original.
- Paste the URL or query parameter into the input box.
- The output updates as you type — no submit button.
- Copy the encoded string into your URL builder, fetch call, or query string.
- When in doubt, encode each query parameter individually rather than the whole URL.
Common use cases
- Building a search URL where the query contains spaces or special characters.
- Generating a redirect URL that passes another URL as a parameter.
- Constructing a deep link with non-ASCII text (Korean, Japanese, emoji) in the path.
- Decoding a webhook payload where parameters are URL-encoded twice.
- Sanity-checking that a third-party callback URL is properly escaped.
- Encoding a base64 string before placing it in a URL — the + and / are unsafe.
Frequently asked questions
Q. What is the difference between encodeURI and encodeURIComponent?
A. encodeURI keeps reserved URL characters (: / ? & =) intact — use it for whole URLs. encodeURIComponent escapes them too — use it for individual parameter values.
Q. Why is a space sometimes encoded as + and other times as %20?
A. + is the legacy x-www-form-urlencoded form (still used in query strings), %20 is the standard percent-encoding used in URL paths. Servers normally accept either in query strings.
Q. Do I need to encode non-ASCII characters?
A. Yes, for compatibility. Modern browsers display Unicode in the URL bar, but the underlying request encodes them as UTF-8 percent-escapes.
Q. Why does decoding produce strange characters?
A. Usually a charset mismatch — the URL was encoded with one encoding (e.g., latin-1) but decoded as another (UTF-8). Fix the source if you can.