URL encoder and decoder online — encodeURIComponent / decodeURIComponent

Percent-encode or decode query strings and path segments—runs locally.

About the URL Encoder Decoder

Percent-encodes text so it can sit safely inside a URL, or decodes %XX sequences back into readable text. It uses JavaScript's encodeURIComponent and decodeURIComponent, so it encodes slashes, question marks, ampersands and equals signs too. That makes it right for a single query value or path segment, such as a redirect URL inside another URL.

How to use the URL Encoder Decoder

  1. Paste the text or encoded string into Input.
  2. Click Encode to percent-encode it, or Decode to turn %XX sequences back into characters.
  3. Copy the result from the output box below the buttons.
  4. If decoding shows an error, look for a stray % that is not followed by two hex digits.

Worked example: putting a URL inside a query parameter

A login link needs ?next= followed by the page to return to. Encoding the inner URL stops its ? and & from being read as part of the outer URL.

Input
https://example.com/cart?id=7&ref=email
Encode output
https%3A%2F%2Fexample.com%2Fcart%3Fid%3D7%26ref%3Demail
Input
Q3 report: sales & returns (final).pdf
Encode output
Q3%20report%3A%20sales%20%26%20returns%20(final).pdf

Quirks that trip people up

  • Do not encode a whole URL you want to visit: encoding https://example.com/a?b=1 turns :// and ? into %3A%2F%2F and %3F, so the result is no longer a working link. Encode only the value that goes after = or between slashes.
  • Plus signs are not spaces here: decoding hello+world%21 gives hello+world!, because + only means space in HTML form encoding. Replace + with %20 before decoding form data.
  • Some characters are left alone: letters, digits and - _ . ! ~ * ' ( ) are never encoded, which is why (final) survives in the example above.
  • Double encoding: encoding text that is already encoded turns %20 into %2520. If you see %25 in a URL, something was encoded twice; decode until it stops changing.
  • Unicode becomes UTF-8 bytes: café becomes caf%C3%A9, two bytes for the é.
  • Malformed input: decoding 50%off fails with "URI malformed" because %of is not a valid hex pair. Encode a literal percent sign as %25.

Fix broken query strings and deep links

Spaces, ampersands, and Unicode in URLs must be percent-encoded or routers and analytics tools mis-parse them. Encoding turns user input into a safe transport form; decoding reveals what a logged redirect actually contained.

Use this when hand-building UTM tags, debugging OAuth callbacks, or unpacking encoded filenames.

encodeURIComponent-style behavior

JavaScript’s encodeURIComponent is the mental model here: good for query values and path segments where reserved characters have special meaning. Decode reverses the process for inspection-always test the final URL in the target browser.

URL Encoder Decoder: frequently asked questions

What is URL encoding used for?
URL encoding converts special characters into a percent-encoded format safe for use in URLs. Characters like spaces, &, =, and # have special meaning in URLs and must be encoded when used as data values in query strings.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves characters like /, ?, and &. encodeURIComponent encodes a URL component (like a query parameter value) and also encodes /, ?, &, =, and #. Use encodeURIComponent for individual parameter values.
How do I decode a percent-encoded URL?
Paste the encoded URL into the input field and select Decode. The tool replaces each %XX sequence with the corresponding character and shows the human-readable result.
Is my data sent to a server?
No. All encoding and decoding runs in your browser using JavaScript's built-in encodeURIComponent and decodeURIComponent functions. Nothing is uploaded.