Tools
URL encoder / decoder
Percent-encode text so it is safe to drop into a URL, or decode an escaped string back to readable text, both powered by the browser's own encodeURIComponent and decodeURIComponent. Below it, a full URL parser breaks any link into its protocol, host, port, path, query parameters, and hash. Everything runs client-side: nothing you paste is uploaded, logged, or stored.
Encode & decode
encodeURIComponent / decodeURIComponent, run in your browser.
URL parser
Break a full URL into its parts and query parameters with the native URL API.
When to encode a URL
A URL can only contain a limited set of characters. Anything outside that set (spaces, accented letters, emoji, and reserved punctuation like &, ?, =, and #) has to be percent-encoded when it appears inside a value. Skip that step and a stray & in a search term will silently split into two query parameters, or a # will lop off everything after it as a fragment. Encoding each value with encodeURIComponent before you concatenate the URL keeps the structure intact.
The URL parser is the inverse: paste a link you are debugging and see exactly how a browser will interpret it: which host it targets, which port, and precisely how each query parameter decodes. It is a fast way to spot a double-encoded value, a missing parameter, or a hash that swallowed part of the query string.
Frequently asked questions
- What is the difference between encodeURIComponent and encodeURI?
- encodeURIComponent escapes every character that has special meaning in a URL (including "/", "?", "&", "=", and "#"), so it is the right choice for a single query-string value or path segment. encodeURI is meant for an entire URL and deliberately leaves those structural characters alone. This tool uses encodeURIComponent because you almost always want to encode a value, not a whole address.
- Why does decoding sometimes throw a "malformed URI" error?
- decodeURIComponent expects every "%" to be followed by two hexadecimal digits (for example %20 for a space). A lone "%", a truncated escape, or something like "%zz" is invalid, so the browser raises a URIError. When that happens the tool catches it and shows an inline message instead of crashing. Usually it means the string was already decoded, or a "%" was meant literally and should have been written as %25.
- Should I encode a space as %20 or as a plus sign (+)?
- In the path and in most modern query strings, a space is %20, which is what encodeURIComponent produces. The "+" convention comes from application/x-www-form-urlencoded form submissions, where "+" means space. When this tool parses a URL it uses URLSearchParams, which correctly decodes both "+" and %20 in the query string back to a real space.
- Is my data sent anywhere?
- No. Every operation runs in your browser using the built-in encodeURIComponent, decodeURIComponent, URL, and URLSearchParams APIs. There are no network requests, no logging, and no storage. Your text and URLs never leave the tab. That makes it safe to paste URLs that contain tokens or session IDs.
- Why does the URL parser require a scheme like https://?
- The native URL constructor only parses absolute URLs, so it needs a scheme (http:, https:, mailto:, etc.) to know how to split the rest. If you paste "example.com/path" it will fail; add "https://" and it parses cleanly into hostname, path, and query. This mirrors exactly how browsers and servers resolve links, so what you see is what real code will see.

