All tools

URL Encode & Decode

URL encoding replaces characters that have a special meaning in a web address — spaces, ampersands, question marks — with percent escapes, so a value can travel inside a link without breaking it. This tool encodes and decodes both single values and whole URLs.

Runs entirely in your browser — nothing you enter is uploaded.

Developer

Escapes / ? & = # as well — use this for a single parameter value.

Try one

About URL encoding

The distinction that matters is between encoding a value and encoding a whole URL. A value going into a query string must have its slashes, ampersands and question marks escaped, or they will be read as structure — an unescaped ampersand inside a search term ends the parameter and starts a new one. A whole URL must keep those characters working, so only genuinely unsafe ones are escaped. Using the wrong one is the usual cause of a link that half works.

Spaces have two representations for historical reasons. %20 is the general encoding and is always correct. A plus sign means a space only inside a query string, and only because HTML form submission defined it that way; in a path segment a plus is a literal plus. When in doubt, use %20, which is unambiguous everywhere.

Common questions

When do I encode a value versus a whole URL?
Encode a value when you are putting one piece of data into a link — a search term, a redirect target, a name. Encode a whole URL when the entire address needs to be made safe but must still function as an address, keeping its slashes and separators intact. Using whole-URL encoding on a value is the usual reason an ampersand in a search term breaks the link.
Why is a space sometimes %20 and sometimes a plus sign?
Both appear because two specifications are in play. Percent-twenty is the general URL encoding for a space and is safe everywhere. The plus sign comes from HTML form submission, where it means a space only within a query string. In a path segment a plus is a literal plus character, so percent-twenty is the safer choice.
Why does my URL contain %2520?
That is a double encoding: a space became %20, and then the percent sign of that escape was itself encoded to %25, giving %2520. It means the value was encoded twice somewhere in the chain. Decoding once here will show you the intermediate form, which usually makes it obvious which step is doing it twice.
Which characters actually need encoding?
Anything with structural meaning — the question mark, ampersand, equals sign, slash, hash and plus — plus spaces and any character outside the unreserved set of letters, digits, hyphen, underscore, full stop and tilde. Non-ASCII characters are encoded as their UTF-8 bytes, which is why a single accented letter can become two escapes.