URL Encoder / Decoder
Encode and decode URLs, and break any URL into its component parts.
Output updates as you type.
Features
- Component and full-URL encoding modes
- Decoding with clear errors on malformed input
- Complete URL breakdown: scheme, host, path, query, fragment
- Query parameter table with decoded values
- Line-by-line batch processing
How to use it
- Pick whether you are encoding a component or a whole URL.
- Paste your text or URL.
- The result and breakdown update as you type.
- Copy the result or feed it back in with Swap.
encodeURI versus encodeURIComponent
These two functions are not interchangeable and picking the wrong one is a routine source of bugs. encodeURI assumes you are handing it a complete URL, so it leaves the structural characters alone: : / ? # [ ] @ ! $ & ' ( ) * +; = all survive. That is correct for a whole URL and wrong for a value inside one.
encodeURIComponent escapes all of those. Use it for anything that goes into a URL, a query parameter value, a path segment, a fragment. If a search term contains an ampersand and you encode it with encodeURI, the ampersand stays literal and the server reads the rest of your term as a separate parameter. Encoded as %26, it arrives intact.
Two details that catch people out. Neither function escapes !'()*, which are legal in URLs but occasionally problematic in specific contexts. And a space becomes %20 in both, whereas in the application/x-www-form-urlencoded body of a form submission a space becomes +. When decoding form data you must convert + back to a space first, or decodeURIComponent will leave plus signs scattered through your text.
Frequently asked questions
Related tools
Further reading
Read the full guide on the 123MiniApps blog.