URL Encoder/Decoder

Encode special URL characters for safe transmission or decode them back to original.

What is URL Encoding?

URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It replaces unsafe ASCII characters with a '%' followed by two hexadecimal digits representing the character's byte value. This ensures URLs remain valid and can be transmitted over the internet without issues.

How URL Encoding Works

URL encoding converts characters into a format that can be transmitted over the internet. Safe characters (A-Z, a-z, 0-9, -, _, ., ~) remain unchanged. All other characters are converted to their UTF-8 byte sequence, with each byte represented as %XX where XX is the hexadecimal value.

Common Use Cases
  • Encoding query parameters in URLs
  • Handling special characters in form submissions
  • Creating safe filenames for web downloads
  • Building API request URLs with dynamic parameters
  • Encoding non-ASCII characters in URLs
Examples
Input: Hello World
Output: Hello%20World
Input: name=John&age=30
Output: name%3DJohn%26age%3D30
Input: https://example.com/search?q=test
Output: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dtest
Frequently Asked Questions

When should I URL encode?

You should URL encode whenever you're including user input or special characters in URLs, especially in query parameters or path segments.

What's the difference between encodeURI and encodeURIComponent?

encodeURI encodes a complete URI and preserves characters like :, /, ?, and #. encodeURIComponent encodes everything except alphanumeric characters and - _ . ~ making it suitable for encoding query parameter values.