URL encoding converts characters into a percent-encoded form so they can be safely transported inside URLs. This prevents reserved characters from breaking query strings or paths.
How to use the URL Encoder/Decoder
- Paste text (or an encoded string) into the input box.
- Click Encode to percent-encode reserved characters.
- Click Decode to restore an encoded string.
- Open the URL Encoder/Decoder
Examples
Encode query parameter value
value = "a&b=c d" encodeURIComponent(value) → "a%26b%3Dc%20d"
Encode full URL (use encodeURI)
encodeURI("https://example.com/a file?q=a&b=c") →
"https://example.com/a%20file?q=a&b=c"
Best practices
- encodeURIComponent for values: Use for query parameter values; it encodes
&,=, and spaces. - encodeURI for full URLs: Keeps
:,/,?,&intact. - Avoid double encoding: Don’t encode an already encoded string.
- Normalize spaces: Prefer
%20over+for consistency.
Common pitfalls
- Using
encodeURIon values (will not encode&or=). - Decoding twice and corrupting data.
- Forgetting to encode path segments containing spaces.
FAQs
Does the tool upload my data?
No. All encoding/decoding happens in your browser.
Why do I see %20 instead of +?
%20 is the standard for spaces. + is used in
application/x-www-form-urlencoded bodies.
Is JSON safe to put in a URL?
Encode JSON as a value with encodeURIComponent, but watch URL length limits.
Try the tool: URL Encoder/Decoder