Free tool
URL Encoder and Decoder
Percent-encode a string so it survives a query parameter, or decode one you have been handed. Both directions, plus a breakdown of what the URL actually contains.
How it works
Paste the string
Drop in a full URL, a single query value, or a path fragment. Anything goes in the same box.
Pick the scope
Component encoding escapes the reserved characters too. Whole-URL encoding leaves the structural ones such as slashes and question marks alone.
Encode or decode
Hit the button and copy the result. The breakdown panel splits a valid URL into its protocol, host, path and parameters.
Component or whole URL?
This is the choice that trips people up. Component encoding is what you want when a value is going inside a URL — a search term, a redirect target, a filename. It escapes the reserved characters, so an ampersand in someone’s search query cannot accidentally start a new parameter.
Whole URL encoding assumes you are handing it a complete address that is already structured correctly. It leaves slashes, question marks, ampersands and hash signs intact and only fixes the genuinely illegal characters, such as spaces and accented letters.
The classic bug is encoding a whole URL when you meant to encode a component. The redirect target loses its query string, and the failure only shows up for the users whose search happened to contain an ampersand.
Why encoded URLs matter for SEO
Search engines treat two URLs that differ by a single character as two different pages. A page reachable at both the encoded and unencoded form is a duplicate, and duplicates split your signals. Consistency is the whole game: pick one canonical form, use it in your internal links, your sitemap and your canonical tag, and stick to it.
Spaces are the usual culprit. A space becomes %20 in a path and + in a query string, and mixing the two on the same site is how you end up with four versions of one page in the index.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent escapes every reserved character including the slash, question mark, ampersand, equals sign and hash, which makes it right for values placed inside a URL. encodeURI leaves those structural characters alone, which makes it right for a complete URL you only need to make legal.
Why does a space sometimes become %20 and sometimes a plus sign?
In the path portion of a URL a space must be %20. In a query string, the older form-encoding convention writes it as a plus sign. Both are accepted by servers in a query string, but only %20 is valid in a path.
Is my data sent to a server?
No. Encoding and decoding both run in your browser using the built-in JavaScript functions. Nothing you paste is transmitted or stored.
Why do I get an error when decoding?
A percent sign that is not followed by two valid hexadecimal digits is invalid percent-encoding, and the decoder refuses it rather than guessing. This usually means the string was already decoded once, or a percent sign was meant literally and should have been written as %25.
Can I decode a URL that was encoded twice?
Yes. Decode once, click Use result as input, then decode again. Double encoding is common when a URL passes through two systems that both escape it.
Related tools
Related reading
SEO Tips
How to Stop Crawl Waste From Eating Your Rankings
Googlebot has a budget for your site. Here is how to stop it burning that budget on pages nobody should see.
Tool Guides
How to Build an XML Sitemap by Hand (and When You Should)
A sitemap is just a text file with rules. Here is the whole format in five minutes.