Why use a URL encoder?
Percent-encoding (or URL encoding) is essential whenever you work with parameters in a URL. Special characters like &, =, ? or spaces must be encoded so they don't break the URL structure.
Without proper encoding, a parameter containing price=10&20 would be interpreted as two separate parameters (price=10 and 20). The browser can't guess your intent: encoding removes the ambiguity.
Three situations where URL encoding is essential:
- Query string parameters - An
&or=in a value splits the string at the wrong place - UTM parameters - Spaces or accented characters in
utm_campaignbreak analytics tracking - Redirects and callbacks - Nested URLs (OAuth, SSO, marketing emails) must be fully encoded
How to use the URL encoder / decoder in 3 steps
Step 1: Paste your content
Paste into the input area:
- Plain text if you want to encode (e.g.
price=10€ & free shipping) - An encoded string if you want to decode (e.g.
price%3D10%E2%82%AC+%26+free+shipping)
Step 2: Select the operation
Click URL encode to transform text into percent-encoding, or URL decode to retrieve the original text from an encoded string.
Step 3: Copy the result
The result appears instantly. Click the copy button to grab the converted string, ready to be inserted into your code, URL or configuration.
What is percent-encoding?
Percent-encoding is the mechanism defined by RFC 3986 for representing special characters in a URI. Each disallowed byte is replaced by % followed by two hexadecimal digits representing its UTF-8 value.
Practical example:
Original text: Café & Thé = 15€
Encoded: Caf%C3%A9+%26+Th%C3%A9+%3D+15%E2%82%AC
The é (U+00E9) takes two bytes in UTF-8 (C3 A9), hence %C3%A9. The € symbol (U+20AC) takes three bytes (E2 82 AC), hence %E2%82%AC.
Unreserved characters (never encoded)
These characters pass through unchanged in a URL:
A-Z a-z 0-9 - _ . ~
Reserved characters (encoded in values)
| Character | Role in the URL | Encoded |
|---|---|---|
? | Start of parameters | %3F |
& | Parameter separator | %26 |
= | Key/value assignment | %3D |
# | Fragment (anchor) | %23 |
/ | Path separator | %2F |
+ | Space (query string) | %2B |
@ | User identifier | %40 |
Encoding table for common characters
| Character | Description | Encoded (query) | Encoded (path) |
|---|---|---|---|
| space | Whitespace | + | %20 |
& | Ampersand | %26 | %26 |
= | Equals sign | %3D | %3D |
? | Question mark | %3F | %3F |
# | Hash | %23 | %23 |
é | E acute accent | %C3%A9 | %C3%A9 |
ñ | N tilde | %C3%B1 | %C3%B1 |
€ | Euro sign | %E2%82%AC | %E2%82%AC |
日 | CJK ideograph | %E6%97%A5 | %E6%97%A5 |
Note: The only difference between query and path encoding is the space character. In a query string (application/x-www-form-urlencoded), the space becomes +. In a URL path, it becomes %20.
Real-world use cases
Case 1: UTM parameters with special characters
Problem: You're creating a tracking link for a campaign named "Summer sale 2025 - 50%".
Without encoding:
https://captaindns.com?utm_campaign=Summer sale 2025 - 50%
The spaces, dash and % break the link. Google Analytics can't capture the campaign.
With encoding:
https://captaindns.com?utm_campaign=Summer+sale+2025+%2D+50%25
Tracking works correctly, every special character is preserved.
Case 2: OAuth callback URL
Problem: You're setting up an OAuth flow and need to pass a return URL as a parameter.
Without encoding:
https://auth.captaindns.com/authorize?redirect_uri=https://captaindns.com/callback?token=abc&scope=read
The server interprets scope=read as a parameter of /authorize, not of /callback.
With redirect_uri encoding:
https://auth.captaindns.com/authorize?redirect_uri=https%3A%2F%2Fcaptaindns.com%2Fcallback%3Ftoken%3Dabc&scope=read
The nested URL is correctly isolated. The OAuth flow works as expected.
Case 3: Debugging a broken email link
Problem: A customer reports that a link in your newsletter doesn't work. The raw link in the email looks like:
https://captaindns.com/offre?nom=Caf%C3%A9+%26+Th%C3%A9&code=PROMO%2D20
Action: Paste the part after ? into the decoder to read the parameters:
nom=Café & Thécode=PROMO-20
This lets you immediately identify whether the values are correct or if double encoding has corrupted the link.
❓ FAQ - Frequently asked questions
Q: What is the difference between URL encoding and Base64?
A: URL encoding (percent-encoding) replaces special characters with %XX to make them URL-safe. Base64 encodes binary data (images, files) into ASCII characters. The two are not interchangeable: use URL encoding for URL parameters, Base64 for transmitting binary data as text.
Q: Why do spaces become + signs?
A: This is a convention of the application/x-www-form-urlencoded format, used by HTML forms and query strings. In URL paths (before the ?), the space is encoded as %20. Both representations are valid in their respective contexts.
Q: Which characters are not encoded?
A: The 66 unreserved characters defined by RFC 3986 are never modified: letters A-Z, a-z, digits 0-9, and four symbols: -, _, ., ~. All other characters are encoded when they appear in a parameter value.
Q: Can I encode a full URL?
A: No, only encode the parameter values. Structural separators (://, /, ?, &, =) must remain as-is for the URL to stay functional. For example, encode the value Café & Thé but not the ? or & that structure the URL.
Q: What happens with double encoding?
A: Double encoding turns %26 into %2526 (the % itself gets re-encoded). The server then receives the literal string %26 instead of &. This is a common pitfall with nested redirects. If you suspect double encoding, decode twice and compare the results.
Q: What happens with invalid encoding?
A: If you try to decode an invalid sequence (e.g. %GG or a bare %), the tool displays an explanatory error message instead of a corrupted result. Fix the source sequence before trying again.
Complementary tools
| Tool | Use case |
|---|---|
| Base64 Encoder | Encode binary data to ASCII for APIs and webhooks |
| Slug generator | Turn a title into a clean URL, free of special characters |
| Word counter | Check the length of your parameters before encoding |
| Case converter | Convert text to camelCase, snake_case or kebab-case for your variables |
| Password generator | Create random passwords to embed in your secure URLs |
| Hash generator | Compute MD5, SHA-256 or SHA-512 to verify data integrity |
Useful resources
- RFC 3986 – Uniform Resource Identifier (URI): Generic Syntax (official percent-encoding specification)
- RFC 3987 – Internationalized Resource Identifiers (IRIs) (extension of RFC 3986 for Unicode characters)
- MDN – encodeURIComponent() (JavaScript URL encoding reference)
- WHATWG URL Standard (living specification for URL parsing and serialization)