onlinetools.dev

URL Encode / Decode

Percent-encode or decode URL components and query strings

Runs locally
loading…
About this tool

Characters like spaces, ampersands and non-ASCII letters cannot appear raw in a URL, so they are percent-encoded: a space becomes %20, 你 becomes %E4%BD%A0. This tool encodes text for safe inclusion in URLs and decodes percent-escaped strings back to readable text, including the + convention for spaces used in query strings.

Two encoding modes are offered because JavaScript itself has two: component mode (encodeURIComponent) escapes everything that could delimit a URL, which is what you want for a single query-string value; full-URI mode (encodeURI) preserves structural characters like /, ? and &, for when you are encoding an entire URL that must stay navigable.

Decoding is strict about malformed % sequences — a lone % or %ZZ is reported as an error rather than silently passed through, which is exactly how browsers and servers will treat it.

Frequently asked questions

When do I use component mode versus full-URI mode?
Encoding a value that goes inside a URL (a search query, a redirect target, an email address in a parameter) → component mode, so & and = inside the value don't break the query string. Encoding a complete URL for display or transport → full-URI mode, so the URL structure survives.
Why does + sometimes mean a space?
The application/x-www-form-urlencoded format — used by HTML form submissions and query strings — historically encodes spaces as +. In URL paths, + is just a plus. The decoder here treats + as a space, matching query-string semantics; %20 always works everywhere.
Why is my string double-encoded (%2520)?
%25 is the encoding of % itself, so %2520 means the text %20 was encoded a second time. It happens when two layers of a system each encode. Run decode twice here to unwrap it, then fix the layer that should not be encoding.
Are Unicode characters handled correctly?
Yes — text is encoded as UTF-8 first and each byte percent-escaped, per the WHATWG URL standard. That is why one CJK character becomes three %XX groups.
Related tools