URL Encoder / Decoder

Percent-encode text or URLs, decode encoded strings back to readable text, or break a URL's query string into a key/value table.

Encoding options

Output

✓ Copied!
Encoded text will appear here…

What this URL encoder does

URLs may only contain a limited set of ASCII characters, and several of those (? & = # /) have a structural meaning. Any other character — a space, an accented letter, an emoji, or a literal ampersand inside a search term — has to be percent-encoded: each UTF-8 byte is written as % plus two hex digits.

You need this when building links by hand, putting a redirect URL inside another URL, debugging an API call that returns 400 because of an unescaped &, or reading a tracking link full of%2F and %3D. The tool has three modes: Encode, Decode and Parse query string, which splits a URL into a readable table of parameters.

How to use it

  1. Choose Encode, Decode or Parse query string at the top.
  2. Paste your text into Input, or click Example to load a sample for the current mode.
  3. In Encode mode pick Component for a single value or Full URL for a whole address, and tick Encode spaces as + if the target expects form encoding.
  4. The Output updates as you type. Click Copy, or Swap & flip mode to round-trip the result.
  5. In Parse mode, review the parameter table and click Copy as JSON to get an object (repeated keys become arrays).

Worked example

Encoding the text café & crème = 100% tasty? gives a different result with each option:

Component:        caf%C3%A9%20%26%20cr%C3%A8me%20%3D%20100%25%20tasty%3F
Component + "+":  caf%C3%A9+%26+cr%C3%A8me+%3D+100%25+tasty%3F
Full URL:         caf%C3%A9%20&%20cr%C3%A8me%20=%20100%25%20tasty?

Notice that Full URL leaves &, = and ? alone. That is correct for a complete address, but if this text were a search value it would split into extra parameters — use Component for values.

Parsing https://example.com/search?q=hello+world&tag=js&tag=css&redirect=%2Fdashboard%3Ftab%3D2#results produces four rows: q = hello world, tag = js, tag = css (both flagged as repeated) andredirect = /dashboard?tab=2, plus the base https://example.com/search and the fragment #results.

Options explained

  • Component (encodeURIComponent) encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for query values, path segments and anything you insert into a URL.
  • Full URL (encodeURI) additionally keeps ; , / ? : @ & = + $ #. Use it only to clean up a complete URL that contains spaces or non-ASCII characters.
  • Encode spaces as + replaces %20 with +, matching what browsers send for HTML form submissions.
  • Treat + as a space (Decode) converts + to a space before decoding. Leave it off for path segments, where a plus sign is a literal plus.
  • Parse query string accepts a full URL or just a=1&b=2. It always treats + as a space, like the browser's URLSearchParams.

Limitations

Decoding assumes the bytes are UTF-8, which is what every modern browser and server uses. Strings produced by old systems in Latin-1 (for example %E9 for é) cannot be decoded and will show an error. The parser does not interpret nested structures like a[b]=1; it shows the key literally. Internationalised domain names are not converted to Punycode — that is a separate step done by the browser.

Tips and common mistakes

  • Encode values, not whole URLs. Build the URL from pieces and encode each value separately; encoding the finished URL with Component turns https:// into https%3A%2F%2F.
  • Watch for %25. If you see %2520, something encoded an already-encoded string. Decode twice to recover the original.
  • Encode redirect parameters. A URL passed as a value (?next=…) must be encoded, or its own & will leak into the outer query.
  • Need to encode binary data or credentials instead? Use the Base64 encoder. Escaping text for HTML is a different job — see the HTML entity encoder.

Frequently Asked Questions

What is URL encoding?

URL encoding (percent-encoding, RFC 3986) replaces characters that are not allowed or have a special meaning in a URL with a % followed by the hexadecimal value of each UTF-8 byte. A space becomes %20 and é becomes %C3%A9.

What is the difference between encodeURI and encodeURIComponent?

encodeURI is meant for a complete URL and leaves structural characters such as : / ? # & = intact. encodeURIComponent is meant for a single piece, like a query parameter value, and encodes those characters too so they cannot break the URL.

Should a space be %20 or +?

Both are common. %20 is valid everywhere in a URL. The + form only means a space inside query strings produced by HTML forms (application/x-www-form-urlencoded). Use the "Encode spaces as +" option when you need that format and "Treat + as a space" when decoding it.

Does this tool prevent double encoding?

It warns you. When you encode text that already contains %XX sequences, a notice explains that every % will become %25, so you can switch to Decode instead if the text was already encoded.

Why does decoding show a "Malformed percent-encoding" error?

Decoding fails when a % is not followed by two hex digits, or when the bytes do not form valid UTF-8 (for example a lone %E9 produced by an old Latin-1 encoder). Fix or remove the broken sequence and try again.

Is my data sent to your servers?

No. Encoding, decoding and query parsing use your browser's built-in encodeURIComponent, decodeURIComponent and URLSearchParams functions. Nothing you paste leaves your device.