URL Parser & Encoder
Percent-encode or decode a URL, and see the parts it breaks into.
What you provide
How this calculation works
Percent-encoding replaces characters that have a structural meaning in a URL, or that cannot appear in one at all, with a percent sign and their byte value in hexadecimal. The two encoding modes differ in how much they escape. Component mode escapes everything reserved, including slashes and ampersands, which is what a value going inside a query parameter needs. Whole-URL mode leaves the structural characters intact so the URL stays a URL. When the input parses as a URL, it is also broken into its parts, since query strings are where encoding mistakes usually hide.
What the results mean
- Encode component
- Escapes every reserved character. Use this for a single value, such as a search term going into a query parameter.
- Encode whole URL
- Leaves slashes, question marks and ampersands alone. Use this to repair a URL containing spaces or accented characters without breaking its structure.
- Query parameters
- The decoded name and value of each parameter. Seeing them separated makes it obvious when a value contains a stray ampersand that is splitting it in two.
Common problems and fixes
- A decoded value still shows %20 or %2520
- The value was encoded more than once. %2520 is a percent sign that was itself encoded, so decoding once turns it into %20 and decoding twice gives a space. Somewhere in the chain a string that was already encoded is being encoded again, usually because a value is passed through two layers of framework that both try to be helpful.
- A parameter value is cut short at an ampersand or a plus sign
- The value was inserted into the URL without component encoding, so its own ampersand is being read as a separator. Encode each value individually before assembling the query string, never afterwards. Plus signs have the same problem in reverse: in a query string a plus historically means a space, so a literal plus in a value must be written as %2B.
Frequently asked questions
When should I use component encoding rather than whole-URL encoding?
Component encoding for anything that goes inside a URL, whole-URL encoding for the finished URL. Running a complete URL through component encoding escapes its own separators and produces a string that no longer works as a link, which is the most common mistake with these two functions.
Why do spaces sometimes become %20 and sometimes a plus?
Both appear in the wild. Percent-encoding proper always uses %20, while the older form encoding used by HTML forms uses a plus in query strings. Servers generally accept both in a query string, but %20 is the safer choice everywhere else, and a plus in a path segment means a literal plus rather than a space.
Do non-Latin characters need encoding?
In the URL itself, yes. They are converted to UTF-8 bytes and each byte is percent-encoded, which is why a single accented character can become three escape sequences. Domain names work differently and use punycode instead, so an internationalised domain appears as a string starting xn-- rather than as percent escapes.
Put this on your own site
Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.
<iframe src="https://runthetests.com/embed/url-encoder-decoder/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="URL Parser & Encoder" loading="lazy"></iframe>
Preview it at https://runthetests.com/embed/url-encoder-decoder/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.