encodeURIComponent: for one query value or path segment. Encodes everything except letters, digits and - _ . ! ~ * ' ( ).
URL parser
Split a full URL into its parts, edit its query parameters and rebuild it.Paste a URL with its scheme (https://…) to see its parts.
Everything runs in your browser. Nothing you paste is sent to Tooly's server.
About the URL Encoder/Decoder
Percent-encode text so it can travel inside a URL, or turn %20-style sequences back into readable text. Choose component encoding for a single value, full-URL encoding for a whole address, or form encoding when spaces must become +. Below, paste any link to see its protocol, host, port, path, query parameters and fragment, edit the parameters in a table and copy the rebuilt URL.
How to use the URL Encoder/Decoder
-
Choose Encode or Decode and a mode
Component encodes everything that could break a URL, for one query value or path segment. Full URL keeps : / ? # & = so a whole address still works. Form (+) follows HTML forms and writes spaces as +.
-
Type or paste your text
The result appears as you type. If decoding fails, the error says which sequence is wrong and where. The swap button sends the result back to the input and flips the direction.
-
Take a URL apart
Paste a full URL, including https://, into the URL parser to see each part. Edit, add or remove query parameters in the table, and copy the rebuilt URL.
When to use it
Building query strings and API calls
Encode search terms, email addresses, JSON or redirect URLs before putting them in a query parameter, so &, = and # inside them do not split the parameter.
Reading tracking and redirect links
Decode long marketing or sign-in links to read the UTM tags, the redirect target and the other parameters hidden in the %-encoding.
Fixing broken links
Find a stray % that breaks a link, text that was encoded twice (%2520), or a + that should have been a space, and correct it before publishing.
Frequently asked questions
What is the difference between %20 and + for a space?
%20 is percent-encoding and means a space anywhere in a URL. + means a space only in query strings encoded as application/x-www-form-urlencoded, the format of HTML forms and URLSearchParams; in a path, + is a literal plus sign. Decode text that comes from a form or a query string with Form (+), and write a literal plus as %2B.
When should I use encodeURIComponent and when encodeURI?
Use encodeURIComponent (Component) for a piece of a URL, such as one query value or one path segment: it also encodes / ? & = and #, so they cannot change the structure of the URL. Use encodeURI (Full URL) on a complete address: it leaves those characters alone and encodes spaces, non-ASCII letters, the % sign and characters such as " < > { } that URLs do not allow. Running encodeURI on a single value is a common bug, because an & inside it then starts a new parameter.
Why does decoding fail with a malformed URI error?
Either a % is not followed by two hexadecimal digits, as in 100% or %zz, or the %-encoded bytes are not valid UTF-8: a character cut in half such as %E2%82, or text encoded in the old Latin-1 charset, where é is %E9 instead of %C3%A9. The decoder only reads UTF-8 and shows which sequence failed and where. A literal % must be written %25.
What does %2520 mean?
It is a space that was encoded twice: the first pass turned the space into %20, and the second encoded the % of %20 as %25. Decoding it once gives %20, so decode the result again to get the space. Double encoding usually happens when code encodes a value that was already encoded.
Does the parser change my URL?
The protocol, host, path and fragment are kept as they are, except that browsers write international domain names in punycode (xn--…). The query is rebuilt from the table with URLSearchParams, so spaces come out as + and characters are encoded the standard way: the rebuilt query can look different from the original while meaning the same. Everything runs in your browser and nothing is sent to a server.
Related tools
Browse all free online tools on Tooly — every one runs in your browser, with no account required.