URL Encode and Decode

Make text safe to put in a web address, or read an address full of %20 and %3D. Encode a value, such as a search term with spaces and symbols, so it can go into a query string; encode a whole URL while keeping its slashes and question marks; or decode percent-encoded text back to readable form.

Text

Loading tool…

At a glance

Encode a value
encodeURIComponent: escapes everything except letters, digits and - _ . ! ~ * ' ( )
Encode a whole URL
encodeURI: keeps : / ? & = # so the address still works
Decode
Turns %XX sequences back into text and + into spaces
Errors
Broken % sequences are reported

How it works

  1. Pick the mode

    Encode a value, encode a whole URL, or decode.

  2. Paste the text

    The result updates as you type.

  3. Copy the result

    Use it in your link, code or request.

URL encoding or another tool?

Choose by where the text will go.

OptionBest forTrade-off
URL Encode and Decode (this page)Text inside web addresses.Not for hiding data.
Base64 Encode and DecodeBinary-safe text in tokens and headers.Output is longer.
QR Code GeneratorSharing the finished link.Encode the link first if it has spaces.
JSON FormatterReading JSON that was in a query string.Decode first.
Text CompareComparing two long links.Decode both for easier reading.

Example: a search link with spaces and &

You need a link that searches for “pdf to word & back”.

  1. Choose Encode a value and type pdf to word & back.
  2. The result is pdf%20to%20word%20%26%20back; the & is escaped so it does not split the query.
  3. Add it after ?q= in your link.
  4. To read a link full of % signs, paste it in Decode mode.

When to use URL Encode and Decode

Use it when building links that carry search terms, names or addresses, when reading long tracking or redirect links, and when preparing parameters for an API call. Marketers can check UTM links, and developers can debug query strings.

Reserved and unsafe characters

Characters like ?, &, = and # have special meaning in a URL, and spaces and most non-English characters are not allowed at all. Percent-encoding writes each byte as % followed by two hexadecimal digits, so %26 is & and %20 is a space.

Value versus whole URL

Inside a query value, an unescaped & would start a new parameter, so value encoding escapes it. A whole URL must keep its structure, so whole-URL encoding leaves those separators alone and escapes only spaces and characters that are never allowed.

Non-English text

Hindi and other scripts are first converted to UTF-8 bytes, then each byte is percent-encoded. That is why one Hindi letter becomes several %XX groups, and why browsers can show the readable form in the address bar.

Spaces as %20 or +

In paths and most query strings a space is written %20. In HTML form submissions it is often written as +. This tool encodes spaces as %20 and, when decoding, treats + as a space, which matches what browsers do with form data.

UTM links for marketing

Campaign links often carry utm_source, utm_medium and utm_campaign parameters so analytics tools can see where visitors came from. Encode the value of each parameter, especially if it contains spaces or symbols, so the link does not break when shared on social media or in email.

Reading tracking links

Links in emails often pass the real destination as an encoded parameter, such as url=https%3A%2F%2F. Decoding the link shows where it really leads before you click, a useful check against phishing.

If something looks wrong

Decoding fails with a broken % sequence
Each % must be followed by two hexadecimal digits. The link may have been cut off; copy it again in full.
My whole link stopped working after encoding
You probably used value encoding, which escapes / and ?. Use Encode a whole URL for complete addresses.
A + stayed in my decoded text
In decode mode + becomes a space. If you need a literal plus, it should have been encoded as %2B.
Text was encoded twice
Double encoding turns % into %25. Decode twice to recover the original.

Common questions

Is URL encoding the same as encryption?

No. Anyone can decode it.

Can I encode an email address for a mailto link?

Yes, use value encoding for the subject and body parts.

Is my text stored?

No.

What is the difference between the two encode modes?

Value encoding escapes every reserved character, including / ? & =, and is right for a single query parameter. Whole-URL encoding keeps those characters so the address still works.

Why does a space become %20?

Spaces are not allowed in URLs, so they are written as %20. When decoding, a + is also read as a space, as in form submissions.

Does it handle Hindi text?

Yes. Non-English characters are encoded as UTF-8 percent sequences.

Links and query strings are encoded and decoded locally; tracking parameters are not sent anywhere.