URL Encode & Decode
Query parameter with spaces
Email address
URL with special characters
Encode or decode URL strings (percent-encoding) instantly. Perfect for query strings, API parameters, and debugging URLs.
How to Use URL Encode & Decode
- Select Encode or Decode mode.
- Paste or type your string in the input area.
- The result appears instantly in the output area.
- Click "Copy" to copy the result.
What is URL Encoding?
URL encoding (percent-encoding) replaces characters that aren't allowed in URLs with a % followed by their hex value. Spaces, ampersands, question marks, and non-ASCII characters all need encoding when used inside query parameters or path segments.
Characters That Need Encoding
Spaces can be encoded as %20 or + depending on context. %20 is correct for path segments, while + is only valid in application/x-www-form-urlencoded data (form submissions). Reserved characters like &, =, #, ?, and / have special meaning in URLs and must be percent-encoded when used as literal values in query parameters. Non-ASCII characters (accented letters, CJK characters) get UTF-8 encoded first, then each byte is percent-encoded.
The Double-Encoding Trap
One of the most common bugs: encoding an already-encoded string. If a URL contains %20 and you encode it again, the % becomes %25, giving you %2520. This breaks the URL silently. You see it a lot when passing redirect URLs as query parameters. Encode the redirect URL once, then embed it. Never run the whole final URL through an encoder.
encodeURI vs encodeURIComponent
In JavaScript, encodeURI() encodes a full URL but preserves delimiters like :, /, ?, and #. Use it when you have a complete URL. encodeURIComponent() encodes everything except - _ . ~ and is what you want for individual query parameter values. Getting this wrong is a frequent source of broken API calls.
For encoding binary data as text, try our Base64 Encoder. You can also inspect authentication tokens with the JWT Decoder, or encode special characters for HTML with the HTML Entity Encoder.