Skip to main content
C
CodeUtil

URL Encoder/Decoder

Encode and decode URLs, parse URL components, and build query strings.

Loading tool...

Why I Built This URL Encoder

I use this URL encoder almost daily when debugging API calls. Nothing's more frustrating than a broken link because of a missing %20 or an unencoded ampersand. I lost an entire afternoon once tracking down a bug that turned out to be a single space character in a query parameter. Never again.

The tool does three things I constantly need: encoding text for URLs, decoding URL-encoded strings back to readable format, and parsing URLs into their components. I also added a Query String Builder because I got tired of manually constructing URLs with multiple parameters.

What I Actually Use This For

  • URL Encoding - When I need to pass user input safely through URLs
  • URL Decoding - Debugging those cryptic %20%3D%26 strings from server logs
  • URL Parser - Breaking down complex URLs to see exactly what's going on
  • Query Builder - Building test URLs without typos
  • Component vs Full URL - Because encodeURI vs encodeURIComponent trips everyone up

I often use this alongside the JSON Formatter when debugging API payloads and the Base64 Encoder for those weird cases where binary data ends up in URLs.

The encodeURI vs encodeURIComponent Trap

This one gets everyone. I've seen senior developers mix these up. Here's the rule I follow: if you're encoding a parameter value, use encodeURIComponent. If you're encoding an entire URL that's already formed, use encodeURI.

  • encodeURIComponent - Encodes everything including :, /, ?, &. Use for query parameter values.
  • encodeURI - Preserves URL structure characters. Use for complete URLs.

The tool has a toggle for this because I kept forgetting which one I needed at 2 AM. URL encoding rules are defined in RFC 3986.

Quick Reference: Common Encodings

CharacterEncoded
Space%20 or +
&%26
=%3D
?%3F
/%2F
#%23

Related Articles

Frequently Asked Questions

When should I use URL encoding?

Anytime you're putting user input into a URL. Seriously, every time. I also use it when passing special characters in query parameters or dealing with non-ASCII characters. The number of bugs I've seen from unencoded URLs is embarrassing.

Is my data secure?

Everything runs locally in your browser. I built it this way because I needed to encode URLs containing API keys and tokens during development. Your data never leaves your device.