How to Use the URL Encoder / Decoder
The URL Encoder/Decoder converts special characters in URLs to their percent-encoded format (e.g. spaces become %20, & becomes %26) and decodes them back to human-readable text. It's an essential tool for web developers, API integrators, and anyone working with query strings.
Paste any URL or query string into the encoder to get a properly encoded version safe for use in HTTP requests and web forms. Use the decoder to convert percent-encoded URLs back to readable text for debugging or analysis. The tool handles full URLs, individual components, and raw text.
A key nuance is the difference between encoding a full URL and encoding a URL component. When encoding a full URL, slashes, colons, and question marks should remain unencoded. When encoding just a query parameter value, all special characters including & = + and ? should be encoded. Our tool offers both modes.
π Worked Example
Encoding a URL with special characters:
- Input: https://example.com/search?q=hello world&lang=en
- Encoded: https://example.com/search?q=hello%20world&lang=en
- Input: price=Β£10.50 & discount=10%
- Encoded: price%3D%C2%A310.50%20%26%20discount%3D10%25
Common Use Cases
- β
Encoding query string parameters for safe use in HTTP GET requests
- β
Decoding percent-encoded URLs from server logs or analytics tools
- β
Building API requests with special characters in parameters
- β
Debugging malformed URLs in web applications
- β
Encoding user-submitted data before appending to URLs
- β
Converting Unicode characters to percent-encoded format for compatibility
Frequently Asked Questions
What is URL encoding?
URL encoding (percent encoding) converts characters that aren't safe in URLs to a percent sign followed by their hexadecimal ASCII code. For example, a space becomes %20, the & symbol becomes %26. This ensures URLs are transmitted safely across all systems and protocols.
Which characters need to be URL encoded?
Characters outside the URL-safe set must be encoded: spaces, non-ASCII characters (like Β£, Γ©, δΈ), and reserved characters when used in data contexts (& = + ? # [ ] @ ! $ , ; : / @). Letters, digits, hyphens, underscores, periods, and tildes are always safe.
What is the difference between encodeURI and encodeURIComponent?
In JavaScript, encodeURI() encodes a complete URL and leaves reserved characters like / : ? & = intact. encodeURIComponent() encodes everything including reserved characters and is used for individual query parameter values. Our tool lets you choose the appropriate mode.
Why does a space sometimes appear as + instead of %20?
In HTML form submissions (application/x-www-form-urlencoded), spaces are encoded as + signs rather than %20. In modern URLs, %20 is the technically correct encoding. Some older systems and APIs use + for spaces, so always check which format your target system expects.
What is the maximum URL length?
There's no official limit in the HTTP specification, but browsers and servers impose practical limits. Chrome supports up to 2MB URLs; most servers have limits of 2,048 to 8,192 characters. For very long query strings, consider using a POST request with the data in the body instead.