text
URL encoder
Percent-encode or decode URL components and whole URIs.
Runs 100% in your browser. Nothing you paste is uploaded, stored, or sent to a server.
How to use
- Paste the raw string (a query value, a path segment, or a full URL).
- Choose Component mode to escape reserved characters such as &, =, and /, or URI mode to encode only illegal characters.
- Decode accepts %XX sequences and treats + as a space, which is how many form bodies arrive.
- Copy the result into a browser bar, a fetch() call, or an OpenAPI example.
Spaces, ampersands, and non-ASCII characters cannot sit raw in a URL. Percent-encoding is the fix, but the two JavaScript helpers — encodeURI and encodeURIComponent — are easy to mix up. Component mode is for a single query value. URI mode is for a whole URL that already has structure you want to keep.
The decoder is useful when a log line shows a redirect target that has been encoded twice, or when a form used + for spaces. As with the other tools, the string stays in the tab.
Examples
Query value
a b&c in component mode becomes a%20b%26c. That is safe to place after a key= in a query string.
Full URL
https://example.com/a b in URI mode becomes https://example.com/a%20b. The colon and slashes stay put.
Form body
q=hello+world decodes to q=hello world because + is treated as a space.
When to use which mode
encodeURIComponent escapes everything with a reserved meaning, including /, ?, #, and &. Use it for user input that becomes one path segment or one query parameter. encodeURI leaves those characters alone so you can encode a complete URL that already contains them.
Double-encoding is a common bug: a value that is already %20 gets turned into %2520. If a decoded string still looks encoded, run decode again. If it still looks encoded after two or three passes, it may just contain a literal percent.
This tool does not validate that a URL is well-formed or that a scheme is allowed. It only applies percent-encoding rules.
FAQ
Why is slash encoded in one mode and not the other?
Component mode assumes the slash is data. URI mode assumes the slash is a path separator. Pick the mode that matches the slot you are filling.
Does decode handle + as space?
Yes. That matches application/x-www-form-urlencoded. If you need a literal plus, it should already be %2B in the input.
Can I encode a full data URL?
URI mode will encode illegal characters but will not rebuild a data URL for you. For Base64 payloads, use the Base64 tool first.
Is the string uploaded?
No. Encoding is local.