Skip to content
WebUtilityHub

URL Encoder / Decoder

Percent-encode text so it is safe to put in a link, or decode an encoded URL back into readable text. Choose the encoding type that matches where the text will go.

Action
Encoding type

For a single value such as a query parameter or a path segment. Encodes everything except letters, digits and - _ . ! ~ * ' ( ).

How to use the URL Encoder / Decoder

  1. Choose “Encode” or “Decode”.
  2. Pick the encoding type. “URL component” suits most cases, such as a single query-parameter value.
  3. Type or paste your text. The result updates as you type.
  4. Copy the result, or use “Swap input and result” to check that it converts back to the original.

Examples

Encode a query-parameter value (URL component)
Input
café & crème = 50% off
Result
caf%C3%A9%20%26%20cr%C3%A8me%20%3D%2050%25%20off
Encode a whole URL (Full URL)
Input
https://example.com/search?q=new shoes&size=42
Result
https://example.com/search?q=new%20shoes&size=42
The characters that give the URL its structure (:, /, ?, & and =) are kept.
Decode form data (Form data)
Input
name=Zo%C3%AB+Martin&city=S%C3%A3o+Paulo
Result
name=Zoë Martin&city=São Paulo

What gets encoded in each mode

URL component leaves only letters, digits and - _ . ! ~ * ' ( ) as they are and encodes everything else, including / ? & = #. That makes the value safe anywhere inside a URL.

Full URL additionally keeps ; , / ? : @ & = + $ #, so a complete address stays usable. When decoding in this mode, encoded versions of those characters (for example %2F for “/”) are left encoded, so the decoded URL keeps the same meaning.

Form data follows the HTML standard for form submissions: spaces become +, and every other character except letters, digits and * - . _ is percent-encoded.

Checking your result

“Swap input and result” moves the result into the input and switches between encoding and decoding. If the converted text matches your original, the round trip is safe.

If a decoded value looks like a long run of letters, digits, “+” and “/”, it may be Base64: try the Base64 decoder. If it is JSON, the JSON Formatter makes it readable and checks that it is valid.

Common uses

  • Building links with search terms, names or addresses in the query string.
  • Reading encoded URLs from logs, analytics reports or redirect chains.
  • Preparing values for API requests and webhooks.
  • Debugging double-encoded links such as “%2520” instead of “%20”.
  • Decoding form submissions captured in browser developer tools.

Limitations

  • Encoding a whole URL as a “URL component” also encodes “:” and “/”, which breaks the link. Use “Full URL” for complete addresses.
  • “Full URL” cannot tell whether a “&” or “=” inside a value belongs to the data or to the URL structure. Encode each value separately as a component when in doubt.
  • The decoder expects UTF-8, which modern websites use. Links made with old encodings such as Latin-1 (for example “%E9” for “é”) are reported as invalid.
  • International domain names are not converted to Punycode (the “xn--” form).

Frequently asked questions

What is URL encoding?

URLs can only contain a limited set of characters. URL encoding, also called percent-encoding, replaces every other character with “%” followed by two hexadecimal digits for each of its UTF-8 bytes. A space becomes %20 and “é” becomes %C3%A9.

Which encoding type should I choose?

Use “URL component” for a single value you insert into a URL, such as a search term or a file name; this is what JavaScript's encodeURIComponent does. Use “Full URL” to clean up a complete address while keeping its structure, like encodeURI. Use “Form data” for HTML form submissions and application/x-www-form-urlencoded request bodies, where spaces become “+”.

Why is a space sometimes %20 and sometimes +?

In the path and most of a URL, a space is %20. In HTML form data and many query strings built from forms, a space is written as “+”. The “Form data” mode encodes and decodes spaces as “+”; the other modes use %20 and leave “+” unchanged when decoding.

What does “The input may have been encoded twice” mean?

When text is encoded twice, “%” itself is encoded as %25, so a space appears as %2520. After one decoding pass you still see %20. Click “Decode again” to decode the next layer.

Why do I get an error when decoding?

A “%” must always be followed by two hexadecimal digits, and multi-byte sequences must form valid UTF-8. The error message shows the position of the first problem. A literal percent sign must be written as %25.

Format, minify and validate JSON with precise error locations. Numbers and key order are preserved.

Developer

Generate one or many random UUID v4 values using your browser’s cryptographically secure generator.

Developer