URL Encoder & Decoder
Percent-encode and decode URL components or full URIs safely.
: / ? # & = + so query parameter values cannot break URL structure.What Does the URL Encoder & Decoder Do?
The URL Encoder & Decoder converts reserved and non-ASCII characters into RFC 3986 percent-encoded triplets (such as %20 for space or %26 for ampersand) and decodes percent-encoded strings back into readable text.
It provides explicit control over Component mode (encodeURIComponent, which encodes ':', '/', '?', '&', and '=') versus Complete URL mode (encodeURI, which keeps URL structure delimiters intact).
When decoding query strings originating from HTML application/x-www-form-urlencoded forms, you can toggle '+' to space conversion and safely inspect malformed '%XX' sequences without unhandled crashes.
How to Use This Tool
- Choose 'Encode' or 'Decode' and select either 'URL Component (Query Value)' or 'Complete URL'.
- Paste your text or URL into the input field.
- Copy the transformed output or review the breakdown comparing Component vs Full URI encoding.
Common Engineering Use Cases
- Encoding user-supplied search queries, callback URLs, or filter expressions before appending them to a query string.
- Decoding unreadable URLs copied from server access logs, analytics referrals, or OAuth redirect parameters.
- Verifying whether a parameter should use encodeURIComponent or encodeURI in frontend code.
Practical Developer Examples
Encoding a Callback URL as a Query Parameter
When passing a URL inside another URL's query parameter, use Component mode so?, &, and = are escaped.
https://app.example.com/callback?env=prod&ok=true
https%3A%2F%2Fapp.example.com%2Fcallback%3Fenv%3Dprod%26ok%3Dtrue
Common Mistakes & Pitfalls to Avoid
- Using encodeURI() on a query parameter value that contains '&' or '=', which allows the value to break out and inject extra query parameters.
- Using encodeURIComponent() on an entire URL including 'https://', which turns the scheme into 'https%3A%2F%2F' and makes it unclickable as a link.
- Double-encoding an already percent-encoded URL, turning '%20' into '%2520'.
Frequently Asked Questions
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes every reserved delimiter (:, /, ?, #, &, =, +) and is meant for individual query parameter keys and values. encodeURI preserves URL structure characters so a complete URL remains a valid navigable address.