πŸ”—

URL Encoder & Decoder

Encode and decode URLs instantly. Convert spaces to %20, special characters to percent encoding. Perfect for API requests, query parameters, and web development.

⚑ Instant Conversion πŸ”„ Bidirectional πŸ“‹ Copy to Clipboard
Paste your text below
πŸ’‘

Quick Examples - Click to Try

πŸ”— URL with Spaces
https://example.com/search?q=hello world
πŸ“§ Email Link
mailto:user@example.com?subject=Hello & Greeting
πŸ’² Special Characters
Price: $100 (20% off!)
🌍 International Characters
https://example.com/cafΓ©/rΓ©sumΓ©.pdf

πŸ”€ Common Encodings

Character Encoded
Space %20
! %21
# %23
$ %24
& %26
@ %40

πŸ’‘ Pro Tips

  • πŸ”’ Encode URL: For complete URLs with protocol
  • 🎯 Encode Component: For query parameter values
  • πŸ”“ Decode: Converts %20 back to readable text
  • ⚑ Use Component for API parameters & user input
  • ✨ Double-check decoded output for accuracy

URL Encoder & Decoder Use Cases

πŸ”— Encode URL with Spaces

Convert spaces to %20 for valid URLs. When you paste "https://example.com/hello world" into a browser, it breaks. Use our encoder to convert it to "hello%20world". Essential for sharing URLs with spaces in filenames, search queries, or folder paths.

🎯 Encode Query Parameters for API

Building API requests? Use "Encode Component" for query string values. If you're passing user input like "Price: $100 & free shipping" as a URL parameter, encode it to %24100%20%26%20free. Prevents API errors from special characters (&, =, ?, #).

🌐 Decode URL from Analytics

Google Analytics shows URLs as "example.com/caf%C3%A9"β€”hard to read! Paste encoded URLs here to decode them back to readable text "cafΓ©". Perfect for analyzing traffic sources, understanding UTM parameters, or debugging redirect URLs.

πŸ“§ Encode Email Links (mailto:)

Creating mailto links with pre-filled subject/body? Encode special characters in subject lines. "Subject: Meeting @ 3PM (Conference Room #5)" becomes "Meeting%20%403PM%20%28Conference%20Room%20%235%29". Works on all email clients without errors.

πŸ” Encode Search Terms

Building a custom search URL? Encode user queries before adding to URL. "how to fix laptop?" becomes "how%20to%20fix%20laptop%3F". Use this for Google search URLs, site search features, or marketplace filters.

🌏 Encode Non-English Characters

URLs with accents, emojis, or non-Latin characters need encoding. "cafΓ©.com/rΓ©sumΓ©.pdf" β†’ "caf%C3%A9.com/r%C3%A9sum%C3%A9.pdf". Ensures URLs work across all browsers and servers. Required for international websites and multilingual content.

URL Encoding Explained

When Do You Need URL Encoding?

  • Spaces: URLs can't contain spacesβ€”must be %20 or +
  • Special Characters: &, ?, =, #, %, @, ! break URL structure
  • Non-ASCII: Accents (Γ©, Γ±), emojis (😊), Cyrillic need encoding
  • Query Parameters: User input in ?q= must be encoded
  • Path Segments: Filenames with special chars in URLs

encodeURI vs encodeURIComponent

Function Use Case What It Encodes
encodeURI Full URLs Spaces, accents; keeps :/?#&=
encodeURIComponent Query params Everything except A-Z, 0-9, -_.~

Example: For API query ?name=John & Jane, use encodeURIComponent on "John & Jane" β†’ "John%20%26%20Jane". For full URL like https://example.com/cafΓ©, use encodeURI β†’ "https://example.com/caf%C3%A9".

Common URL Encoding Mistakes

  • ❌ Not encoding query params: ?q=a&b breaks (& separates params)
  • ❌ Double encoding: Encoding already-encoded URLs
  • ❌ Using + for spaces: + only works in query strings, not paths
  • ❌ Encoding entire URL with Component: Breaks ://
  • βœ… Correct: Encode only the user-input parts (query values, path segments)

Real-World Examples

API Request:

Before: https://api.example.com/search?q=coffee shops near me
After: https://api.example.com/search?q=coffee%20shops%20near%20me

Google Search:

Before: https://google.com/search?q=c++ tutorial
After: https://google.com/search?q=c%2B%2B%20tutorial

File Download:

Before: https://cdn.example.com/files/2024 Report (Final).pdf
After: https://cdn.example.com/files/2024%20Report%20(Final).pdf

Copied!