Quick access

Saved in this browser. Sign in to keep it on all your devices.

URL Encoder/Decoder

Encode and decode URL components safely. Handle special characters in URLs with ease.

Component vs Full URL Encoding

Encode Component: Encodes query parameters and special characters (spaces, &, =, ?, etc.) for safe URL transmission.

Encode Full URL: Preserves URL structure (: / # ?) while encoding other special characters.

Component Encoding

Encode individual URL components like query parameters, paths, and fragments safely.

Full URL Encoding

Encode complete URLs while preserving the structure and special URL characters.

Real-time Preview

See encoded/decoded output instantly as you type with auto-detection.

Common Use Cases

Query Parameters

name=John Doe&city=New York

becomes

name=John%20Doe&city=New%20York

Special Characters

Hello & Welcome!

becomes

Hello%20%26%20Welcome!
2M+
URLs Encoded
100%
Client-side
0
Data Sent
24/7
Available
Version 1.1 Updated What's new

Release notes

  1. v1.1 Latest
    • Added an in-depth guide below the tool, written from what the tool actually does.

About the URL Encoder/Decoder

URL encoding (percent-encoding) replaces characters that are not allowed in a URL, such as spaces, &, and non-English letters, with a % sign followed by their hex code.

How to use it

  1. 1 Paste the text or URL.
  2. 2 Choose Encode or Decode.
  3. 3 Copy the result into your link or code.

Frequently asked questions

Why is a space encoded as %20?

Spaces are not allowed in URLs. %20 is the hex code for the space character. In HTML form data a space can also appear as +.

Should I encode the whole URL?

Usually not. Encode each query parameter value separately so that characters like ?, &, and = keep their meaning in the URL.

Is URL encoding the same as Base64?

No. URL encoding only escapes unsafe characters and leaves the rest readable, while Base64 rewrites all of the data.

Which characters get a percent sign

A URL may only contain a small set of characters as they are: the letters A–Z and a–z, the digits 0–9 and the four marks - _ . ~. Everything else is written as a % sign followed by two hex digits for each UTF-8 byte. Some characters have a job inside a URL, such as / between folders, ? before the query, & between parameters and = between a name and a value. They must be encoded whenever they are part of a value rather than doing that job.

space        →  %20
&            →  %26
=            →  %3D
/            →  %2F
café         →  caf%C3%A9
ঢাকা         →  %E0%A6%A2%E0%A6%BE%E0%A6%95%E0%A6%BE

A non-English letter becomes two or three encoded bytes, which is why a Bangla or Arabic link turns so long when you copy it out of the address bar.

Encode Component or Encode Full URL

The two buttons follow the JavaScript functions encodeURIComponent and encodeURI. Typing in the input box runs Encode Component on the fly.

  • Encode Component escapes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for one piece of a URL: a search term, a parameter value, or a whole URL passed as a value, such as ?redirect=https%3A%2F%2Fexample.com%2Fcart.
  • Encode Full URL leaves : / ? # & = + $ , ; @ alone and only escapes spaces, non-English letters and other characters that can never appear in a URL. Use it to tidy a complete address that someone typed with spaces in it.

Running Encode Component on a whole address breaks it, because https:// becomes https%3A%2F%2F and the browser no longer sees a link. Running Encode Full URL on a value is the opposite mistake: an & inside the value stays as it is and splits the parameter in two.

Plus signs, %2520 and decoding errors

HTML forms send spaces as + instead of %20. The decoder treats + as a real plus sign, as the URL standard says, so a query copied from a form submission such as q=red+shoes decodes to “red+shoes”. Replace the plus signs with spaces first if the text came from a form.

If you see %2520 in a link, the text was encoded twice: the % of %20 was itself turned into %25. Decode once and check whether the result still has %20 in it; if it does, the original was double encoded and should be fixed where the link is built.

Decoding fails with an error when a % is not followed by two hex digits, as in “100% cotton”, or when the bytes do not form valid UTF-8. Encode such text rather than decoding it.

Encoding inside code

Most languages have a built-in function, and it is safer to call it than to paste in encoded strings by hand:

  • JavaScript: encodeURIComponent(value), or new URLSearchParams({ q: value }).toString() for a whole query string.
  • PHP: rawurlencode($value) gives %20 for spaces; urlencode($value) gives + like a form; http_build_query($array) builds a full query string.
  • Python: urllib.parse.quote(value, safe='') for a component and urllib.parse.urlencode(dict) for a query string.

The converter is handy for checking what those functions produce, for reading an encoded link from a log, or for building a one-off link by hand. Everything runs in your browser, so nothing you paste is sent anywhere.