URL encoder / decoder
URLs allow only certain ASCII characters unescaped — spaces, ampersands, and Unicode must become percent-encoded (%20, %26, UTF-8 bytes). Encode strings before building query params; decode messy copied links to read values — essential for web dev debugging.
Input
Output
Hello%20world
How to URL encode or decode
1. Select encode or decode.
2. Paste plain text or percent-encoded URL component.
3. Copy result for fetch URL or analytics tag.
4. Use encodeURIComponent for query values, not full URLs blindly.
URL encoding examples
Search query
"coffee & tea" as query becomes coffee%20%26%20tea in ?q= parameter.
Unicode city name
München encodes to M%C3%BCnchen in UTF-8 percent encoding.
Decode redirect param
Read ?next=%2Fdashboard%3Ftab%3D1 to learn redirect target path.
When to URL encode
• When building query strings manually in tests.
• When debugging broken links with special characters.
• When decoding analytics UTM parameters from logs.
Common mistakes
• Do not encode entire URL including protocol — encode components separately.
• Do not double-encode — %2520 means encoded twice.
• When path already encoded in router — decode once only.
RFC 3986 basics
Reserved characters like ? # & have meaning in URLs — encode only data parts. Structure: scheme://host/path?query#fragment.
OAuth redirect URIs
Exact encoding matters — mismatch breaks login. Copy registered redirect byte-for-byte.
Log analysis
Decode user-agent and referer params carefully — broken encoding causes wrong attribution in dashboards.
Frequently asked questions
encodeURI vs encodeURIComponent?
encodeURI keeps :// and ? for full URLs; encodeURIComponent encodes everything for query values — JS distinction applies conceptually.
Plus vs %20?
Query strings often treat + as space in application/x-www-form-urlencoded — know context.
Slashes in params?
encodeURIComponent encodes / to %2F — required inside single param value.
Local?
Yes.
IDN domains?
Unicode domains use punycode in DNS — separate from path encoding.
HTML entities?
URL encoding differs from & HTML escaping — use htmlEncoderDecoder for markup.