URL Encoder & Decoder
Encode special characters for URLs or decode percent-encoded strings back to readable text.
No data sent to serverRelated Tools
What is URL Encoding?
URL encoding (also called percent-encoding) is a mechanism for converting characters that are not allowed in a URL into a format that can be transmitted over the internet. Special characters like spaces, ampersands (&), and non-ASCII characters are replaced with a percent sign (%) followed by their hexadecimal byte values.
For example, a space becomes %20, an ampersand becomes %26, and the Japanese character "東" becomes %E6%9D%B1. URL encoding is defined by RFC 3986 and is essential for building valid query strings, form submissions, and API requests.
This tool uses JavaScript's encodeURIComponent() for encoding, which encodes all characters except A-Z a-z 0-9 - _ . ~ ! * ' ( ). For decoding, it uses decodeURIComponent() to restore the original text.
How to Use
- Paste your plain text or URL-encoded string into the input box.
- Click "Encode" to percent-encode the text, or "Decode" to convert it back.
- Copy or download the result.
Common scenarios
- Query parameters:
?q=hello world→?q=hello%20world - OAuth redirect URIs: nested URLs need double encoding
- mailto: links:
mailto:foo@bar.com?subject=Hi%20there - tel: / sms: deep links: phone numbers with spaces need encoding
- Filenames in CDN URLs:
My File.pdf→My%20File.pdf - API key parameters: special characters in keys must be encoded
Common pitfalls
- Double encoding: encoding an already-encoded string.
%20becomes%2520— annoying bug - + vs %20: form data (
application/x-www-form-urlencoded) uses+for spaces; URI encoding uses%20. This tool uses%20(URI standard) - Encoding the wrong slash:
/in path segments shouldn't be encoded. Only encode individual segment values - Path traversal in decoded input:
%2e%2e%2fdecodes to../— always validate decoded values before filesystem use
FAQ
What is the difference between encodeURI and encodeURIComponent?
encodeURI() encodes a full URI but leaves reserved characters like : / ? # & intact — for whole URLs. encodeURIComponent() (used by this tool) encodes those too — for individual query parameter values or path segments. Rule: use encodeURIComponent for one piece at a time.
Why do I need to URL-encode query parameters?
Characters like &, =, ?, # have special meaning in URL syntax. If your parameter values contain them, they must be encoded so the URL parser doesn't misinterpret them as separators.
Does it handle Unicode characters?
Yes — Korean, Chinese, emoji, and accented characters all encode correctly. They're UTF-8 encoded first (3 bytes per Korean char, 4 bytes per emoji), then each byte is percent-encoded.
Why does + sometimes appear instead of %20?
HTML form submissions (application/x-www-form-urlencoded) use + for spaces. URI percent-encoding uses %20. This tool always produces %20 — the URI standard. If you need +, manually replace after encoding.
Should I encode the entire URL?
No — only encode the parts that are data (query parameter values, path segments). Encoding the entire URL (including :/?) breaks routing. encodeURI() is for whole URLs; encodeURIComponent() for individual pieces.
What's the maximum URL length?
HTTP spec doesn't define a limit, but most servers and browsers cap around 2,048 characters. Long URLs can fail silently or cause 414 (URI Too Long) errors. For long parameters, use POST instead of GET.
⚠️ Reference Only
Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.
Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.