About the URL Encoder / Decoder
URL encoding (percent-encoding) replaces characters that aren't allowed in a URL — spaces, ampersands, slashes, non-ASCII characters, and more — with a % followed by their hex code, so the URL remains valid and unambiguous.
This is essential any time you're building a query string, a redirect URL, or an API request by hand and need to make sure special characters in a value (like a search term with spaces, or an email address) don't break the URL structure.
How it works
- Paste the text or URL component you want to encode or decode.
- Click Encode to percent-encode reserved and special characters, or Decode to convert a percent-encoded string back to readable text.
- Copy the result directly into your URL, query string, or code.
Common use cases
- Query parameters: Encoding a user-provided search term like `coffee & tea` into `coffee%20%26%20tea` so it's safe inside a `?q=` parameter.
- Reading webhook payloads: Decoding a percent-encoded value you see in server logs or a browser's network tab to understand what was actually sent.
- Building redirect URLs: Encoding a `returnTo` URL so it can safely be embedded as a value inside another URL's query string.
Frequently asked questions
What's the difference between encodeURIComponent and encodeURI?
encodeURIComponent (what this tool uses for encoding) escapes nearly every special character, making it correct for encoding individual query parameter values. encodeURI is meant for encoding a whole URL and leaves characters like `/`, `:`, and `?` untouched since they're structurally meaningful there.
Why do spaces sometimes become + and sometimes %20?
%20 is the standard percent-encoding for a space. The + shorthand for space is specific to the `application/x-www-form-urlencoded` format used in HTML form submissions and query strings — not a general URL-encoding rule.
Do I need to encode an entire URL, or just parts of it?
Usually just the dynamic parts — like a user-entered value going into a query parameter — not the whole URL, since encoding structural characters like `://` or `?` would break it.
Why did decoding fail?
The input contains a malformed percent sequence, such as a lone % not followed by two valid hex digits. Make sure you're decoding a string that was actually percent-encoded, not raw text.
This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.