Outils Développeur
Verified Tool

URL Encoder/Decoder

Encode and decode URLs and query strings

Last Updated: January 15, 2026
avatarBy Viblaa Team

Real-time encoding/decoding

Full UTF-8 support

One-click copy

Clean interface

You're building a search feature, and a user types "Nike Air Max 90 (Women's)" into the search box. You construct the URL, click the link, and... it breaks. The parentheses and apostrophe have corrupted your carefully crafted URL.

Welcome to the world of URL encoding—where perfectly innocent characters turn into landmines for web developers.

The URL Encoder/Decoder converts special characters into URL-safe format (and back again). It's the difference between a working deep link and a 404 error, between a successful OAuth flow and a silent authentication failure.

If you work with APIs, build share links, or debug broken URLs, this tool will save you hours of frustration.

📌Key Takeaway

The core problem: URLs can only contain certain ASCII characters. Spaces, ampersands, question marks, and international characters must be converted to a special format—or your links will break in subtle, infuriating ways.

What is URL Encoding?

URL encoding (also called percent encoding) converts characters into a format that URLs can safely transmit. Since URLs only support certain ASCII characters, anything outside this safe set must be encoded.

✨
How It Works

Special characters are replaced with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII value. A space becomes %20, an ampersand becomes %26, and so on.

Characters That Must Be Encoded

CharacterEncodedWhy It's Reserved
Space%20 (or +)Spaces break URLs
&%26Separates parameters
=%3DSeparates key-value pairs
?%3FStarts query string
#%23Starts fragment identifier
/%2FPath separator
+%2BSometimes means space

What URL Encoding Does NOT Do

Let's be clear about what this isn't:

  • NOT encryption: Anyone can decode it instantly
  • NOT compression: Usually makes strings longer
  • NOT sanitization: Doesn't protect against security issues

It's purely a format conversion for URL compatibility (RFC 3986).

👨‍💻Pro Tip

Developer insight: When building URLs programmatically, always use your language's built-in encoding functions (encodeURIComponent() in JavaScript, urllib.parse.quote() in Python) rather than manual string replacement. They handle edge cases you'll miss.

Why People Actually Need This Tool

đź’ˇ
The Pain Point

When URLs break silently due to unencoded special characters, developers can spend hours debugging issues that take seconds to fix with proper encoding.

Here are 6 real situations where this tool saves the day:

  1. Building API Requests: User-generated content in URL parameters must be encoded, or the request fails mysteriously.

  2. Creating Share Links: Deep links with personalized data (names, messages) need encoding to preserve the exact text.

  3. Debugging Broken URLs: When a URL doesn't work, decoding it reveals whether encoding is the culprit.

  4. Reading Encoded Data: Server logs and analytics tools show encoded URLs. Decoding makes them human-readable.

  5. Testing OAuth Flows: Redirect URIs and state parameters must be properly encoded for authentication to work.

  6. Email Marketing Links: Tracking parameters with special characters (especially @ symbols in email addresses) need encoding.

How to Use the URL Encoder/Decoder

This takes about 5 seconds:

  1. Choose Mode: "Encode" converts text to URL-safe format; "Decode" converts it back
  2. Paste Your Text: Enter the string you want to process
  3. Get Instant Results: Conversion happens as you type
  4. Copy the Output: Click the copy button and paste it wherever you need it

This tool processes everything locally in your browser—your URLs, including any sensitive parameters like API tokens or authentication data, never leave your device.

Understanding the Output

When you encode a full URL like:

https://example.com/search?q=hello world&lang=en

The result becomes:

https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den

Or if you just encode the query value (recommended):

hello world → hello%20world
📌Key Takeaway

Best practice: Only encode the values in your query parameters, not the entire URL structure. Encoding the full URL (including :// and /) will break it when you try to use it.

Real-World Use Cases

Here's exactly how developers use this tool:

1. E-commerce Search Implementation

Context: You're building search for an online store.
Problem: Users search for "Nike Air Max 90 (Women's)" but the URL breaks—parentheses and apostrophe aren't URL-safe.
Solution: Encode the search term: Nike%20Air%20Max%2090%20%28Women%27s%29
Outcome: Search works correctly, users can share and bookmark results.

2. OAuth Callback Configuration

Context: You're implementing Google OAuth for your app.
Problem: Your callback URL https://myapp.com/auth?source=google&redirect=/dashboard isn't working.
Solution: Properly encode the redirect URI before sending it to Google.
Outcome: OAuth flow completes successfully, users land on the correct page.

3. Analytics Debug Mode

Context: You're analyzing traffic from an email campaign.
Problem: The utm_content parameter shows %2520special%2520offer in your analytics.
Solution: Decoding reveals double-encoding (space → %20 → %2520). You fix the campaign links.
Outcome: Future campaigns track correctly with accurate data.

4. API Integration with International Characters

Context: You're calling a weather API that accepts city names.
Problem: Queries for "SĂŁo Paulo" or "ZĂĽrich" fail silently.
Solution: Encode the city names: S%C3%A3o%20Paulo, Z%C3%BCrich
Outcome: International lookups work correctly across all locales.

5. Building Mailto Links

Context: You want to pre-populate an email subject and body.
Problem: Line breaks and special characters in the body break the mailto link.
Solution: Encode subject and body: mailto:?subject=Hello%20World&body=Please%20review%3A%0A%0A
Outcome: Clicking the link opens an email with the exact intended content.

6. Troubleshooting Webhook Failures

Context: Your Stripe payment webhook sometimes fails to parse.
Problem: Some customer names contain & or = that break JSON parsing.
Solution: Decode the payload to see the raw data.
Outcome: You identify the edge case and add proper handling.

7. Creating App Deep Links

Context: You're building a mobile app with deep link support.
Problem: A link to myapp://product/coffee & tea set doesn't open the correct screen.
Solution: Encode the product name: myapp://product/coffee%20%26%20tea%20set
Outcome: Deep links work reliably for all product names.

Common Mistakes and How to Avoid Them

⚠️
Double Encoding is a Silent Killer

If you encode an already-encoded string, you get corruption. A space becomes %20, which becomes %2520 if encoded again. Always verify your data isn't already encoded.

🎯 Double Encoding

✕Mistake
Encoding a string that's already encoded, turning %20 into %2520.
✓Fix
Always check if data is already encoded. Decode first if unsure, then encode once.

🎯 Encoding the Entire URL

✕Mistake
Encoding https://example.com?q=test which breaks the protocol and path structure.
✓Fix
Only encode query parameter VALUES, not the entire URL. The URL structure (protocol, host, path) should remain intact.

🎯 Forgetting Reserved Characters

✕Mistake
Passing search=black & white in a URL, where & is interpreted as a parameter separator.
✓Fix
Always encode user-provided values that might contain &, =, ?, or #.

🎯 Using + Instead of %20 Incorrectly

✕Mistake
Using + for spaces in URL paths (e.g., /products/black+coffee).
✓Fix
Use %20 for spaces in URL paths. The + character for spaces is only valid in query strings (after the ?).

🎯 Not Handling UTF-8 Characters

✕Mistake
Assuming all characters fit in ASCII, breaking names like José or 北京.
✓Fix
Modern URL encoding uses UTF-8. This tool properly handles all Unicode characters by converting them to UTF-8 bytes first.

🎯 Encoding Empty Strings

✕Mistake
Not checking for empty or null values before encoding, causing unexpected behavior.
✓Fix
Always validate input. Empty strings encode to empty strings, but null values may cause errors in some implementations.
👨‍💻Pro Tip

Debugging trick: If a URL isn't working and you're not sure why, paste the entire URL into the decoder. This reveals any hidden encoding issues (like double-encoded spaces) that are invisible when looking at the raw string.

Privacy and Data Handling

This URL Encoder/Decoder processes everything locally in your browser. Your URLs, query parameters, API endpoints, and any data you encode or decode never leave your device.

There's no server-side processing, no logging, and no data retention. This matters when working with URLs containing authentication tokens, API keys, or personal information—your sensitive data stays private.

Conclusion

URL encoding is fundamental for anyone building web applications. While it's a simple concept, getting it wrong causes frustrating bugs that are surprisingly hard to diagnose.

Use this tool whenever you're unsure about encoding, debugging broken links, or working with international characters. It's faster than writing code, more reliable than guessing, and processes everything privately in your browser.

Bookmark this page—you'll need it more often than you think.

Foire Aux Questions