CodeUtils
Loading…

Percent-encode special characters in URLs or query string values, or decode an encoded URL back to plain text. Handles both component encoding and full URL encoding.

Use Cases

  • Encoding query parameter values that contain spaces or special characters
  • Decoding percent-encoded URLs received from third-party APIs
  • Building safe redirect URLs from dynamic user input
  • Debugging double-encoded or malformed URLs

Example

Input
https://example.com/search?q=hello world&lang=en
Output
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den

FAQ

What is the difference between encodeURI and encodeURIComponent?

encodeURI preserves URL structure characters like / and ?, while encodeURIComponent encodes everything — use the latter for individual parameter values.

Can it handle multi-byte Unicode characters?

Yes. Unicode characters are converted to their UTF-8 byte sequences before percent-encoding.