URL Encoder & Decoder — Percent-Encoding Made Easy
URL encoding (percent-encoding) converts special characters into a format safe for URLs. This tool offers both encodeURI (preserves URL structure) and encodeURIComponent (encodes everything for query values). Paste your text below — all encoding runs locally in your browser.
What is URL encoding?
URL encoding (percent-encoding) replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits. For example, a space becomes %20. This ensures special characters are transmitted correctly in URLs. See: RFC 3986.
Why Use This Tool
- Query string parameters — Encode values containing spaces, &, =, or other special characters. Parse query params →
- API requests — Safely include user input in URLs without breaking the request.
- Form data — Encode form values for application/x-www-form-urlencoded content type.
- Deep links — Encode callback URLs and nested parameters in OAuth flows.
- File paths — Encode filenames with spaces or international characters.
- Decode received URLs — Convert percent-encoded URLs back to readable text for debugging.
Tips
- Use encodeURIComponent for query parameter values.
- Use encodeURI only for complete URLs with valid structure.
- Spaces become %20 in percent-encoding.
- Unicode characters are UTF-8 encoded first, then percent-encoded.
- Double-encoding can happen if you encode an already-encoded string.
How to Use the URL Encoder / Decoder
Paste your text or URL
Enter the string you want to encode or a percent-encoded URL to decode.
Choose the encoding mode
Use encodeURIComponent for query parameters. Use encodeURI for full URLs (preserves :, /, ?, &).
Select Encode or Decode
Click Encode to percent-encode special characters, or Decode to convert %XX back to characters.
Copy the result
Click Copy to copy the encoded or decoded string to your clipboard.
Worked Examples
Encode a search query
hello world
hello%20world
Encode special characters
name=John&age=30
name%3DJohn%26age%3D30
Use encodeURIComponent for parameter values.
Encode Unicode text
नमस्ते
%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87
Decode a URL
https%3A%2F%2Fexample.com%2Fpath%3Fq%3Dhello
https://example.com/path?q=hello
Encode with encodeURI
https://example.com/path?q=hello world
https://example.com/path?q=hello%20world
encodeURI preserves URL structure characters.
encodeURI vs encodeURIComponent
| Feature | encodeURI | encodeURIComponent |
|---|---|---|
| Preserves | : / ? # [ ] @ ! $ & ' ( ) * + , ; = | Only A-Z a-z 0-9 - _ . ~ |
| Use case | Encoding full URLs | Encoding query parameter values |
| Space | %20 | %20 |
| Example: / | / (unchanged) | %2F (encoded) |
| When to use | URL has valid structure | Value might contain special chars |
Frequently Asked Questions
What is URL encoding?
URL encoding (percent-encoding) replaces characters that are not allowed in URLs with a percent sign followed by their hexadecimal ASCII code. For example, space becomes %20.
When should I use encodeURI vs encodeURIComponent?
Use encodeURI for full URLs where you want to keep the URL structure (:, /, ?, etc.). Use encodeURIComponent for query parameter values where you need to encode everything.
How do I URL decode in JavaScript?
Use decodeURIComponent(encodedString) for most cases, or decodeURI(encodedUrl) for full URLs. This tool uses the same functions.
How do I URL decode in Python?
Use urllib.parse.unquote(encoded_string) or urllib.parse.unquote_plus() if spaces are encoded as +.
Why are spaces sometimes + and sometimes %20?
In application/x-www-form-urlencoded (HTML forms), spaces are +. In standard percent-encoding (RFC 3986), spaces are %20. This tool uses %20.
Does this URL encoder upload my data?
No. Encoding and decoding run in your browser using JavaScript's built-in encodeURIComponent. Nothing is sent to a server.