URL Encoder / Decoder

Percent-encode or decode URLs and query strings, and break any URL into protocol, host, path and query parameters. Free and private.

How to use the URL encoder

Paste text into the input box and pick an action:

  • Encode component uses encodeURIComponent. It escapes everything that has special meaning in a URL, including / ? & = #. Use it for a single query value or path segment.
  • Encode full URL uses encodeURI. It leaves the URL's structure alone and only escapes characters that can never appear in a URL, such as spaces and non-ASCII letters.
  • Decode reverses percent-encoding and also turns + into a space, which is how HTML forms encode spaces.
  • Parse URL breaks an address into protocol, host, port, path and fragment, and lists every query parameter already decoded. It is the quickest way to read a long tracking link.

Component vs full URL: why it matters

Imagine you are building a link to a search page and the user typed fish & chips. If you drop that straight into ?q=fish & chips, the server sees a parameter q=fish and a second, empty parameter called chips. Running the value through Encode component gives fish%20%26%20chips, which arrives intact.

On the other hand, if you encode an entire URL with Encode component, the slashes and colon get escaped too and the result is no longer a working link. That's what Encode full URL is for. The rule of thumb: encode the pieces with the component encoder, then assemble them. Our article on URL encoding goes deeper, including the %20 versus + question.

What percent-encoding actually does

URLs can only contain a limited set of ASCII characters. Anything else is converted to bytes using UTF-8 and each byte is written as a percent sign followed by two hex digits. A space becomes %20, an ampersand becomes %26, and the letter é (two bytes in UTF-8) becomes %C3%A9. Decoding simply reverses that process.

Troubleshooting

If decoding fails with "malformed" or a similar message, the text contains a percent sign that isn't followed by two valid hex digits, for example 100% in plain text. Encode that percent sign as %25. If you see sequences like %2520, the value was encoded twice; decode it twice to get back to the original.

Frequently asked questions

Should spaces be %20 or +?

Both mean a space in the query string of a form submission, but only %20 is correct in the path. When in doubt, use %20. This tool decodes both.

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters that structure a URL (: / ? & = #). encodeURIComponent escapes them as well, so it is the right choice for individual values.

Why does my decoded text show strange characters like é?

The original bytes were probably encoded using a legacy character set such as Latin-1 instead of UTF-8. Modern browsers and servers expect UTF-8.