URL Encode and Decode

Percent-encode text for URLs and decode it back, with a clear choice between component and full-URI encoding.

What are you encoding?

This tool runs entirely in your browser. Nothing you enter is uploaded to a server.

Percent-encode text so it survives being put in a URL, or decode it back to readable form. The tool makes the choice most others hide: whether you are encoding a single value, where characters like & and ? must be escaped, or a whole URL, where they must not. Nothing is sent to a server.

How to use it

  1. Pick a directionEncode turns text into percent-encoded form; Decode turns it back. You can switch without losing your input.
  2. Say what you are encodingA single value — a query parameter or path segment — or a whole URL. This choice is what most encoders get wrong.
  3. Copy the resultCopy output puts it on your clipboard, or use it as input to chain another conversion.

Why URLs need encoding at all

The URL standard permits a small set of characters: letters, digits, and a handful of symbols. Everything else has to be escaped. Some characters are excluded because they are unsafe in transit — spaces get mangled, quotation marks get eaten by shells. Others are excluded because they already mean something: a question mark begins the query string, an ampersand separates parameters, a hash introduces the fragment.

Percent-encoding solves both problems the same way. Take the character's UTF-8 bytes, write each as two hexadecimal digits, and prefix each with a percent sign. The result contains only safe characters, and any reader knows to reverse it.

The distinction that actually matters

Nearly every online URL encoder gives you one button and quietly picks one behaviour. That is where the bugs come from, because the right answer depends entirely on what you are encoding.

Suppose a user searches for tom & jerry. If you encode only the value, you get tom%20%26%20jerry, and the whole phrase arrives as one parameter. If you encode it as though it were a whole URL, the ampersand survives untouched — and the server reads it as the start of a second parameter. The search silently becomestom, and nobody notices until someone reports that results are wrong.

The reverse mistake is just as common. Encode a complete address with the single-value option and every slash and colon becomes an escape sequence, producing a string that is no longer a URL at all.

Where you will meet it

Query strings and search parameters. OAuth redirect URIs, which must be encoded when passed as a parameter to an authorisation endpoint. API requests carrying filters or dates. Analytics campaign tags. Anywhere a value that might contain punctuation has to travel inside an address.

It also shows up in reverse when you are debugging: a log line full of %2F and%3A is far easier to read once decoded, which is often the reason people reach for a tool like this in the first place.

Privacy

Everything happens in your browser. The page is static, there is no backend and no request leaves your device. Given how often the URL being decoded contains an access token, a session identifier or a customer's search terms, that is the point rather than a bonus.

Frequently asked questions

What is URL encoding?

A URL may only contain a limited set of ASCII characters. Anything else — a space, an accented letter, an emoji, a slash inside a value — has to be represented as a percent sign followed by the hexadecimal bytes of its UTF-8 encoding. A space becomes %20, an ampersand becomes %26, and é becomes %C3%A9.

What is the difference between the two options?

Encoding a single value escapes the delimiters too, so & = ? / and # become %26 %3D %3F %2F and %23. That is essential when the value itself contains one of them — otherwise it would look like the start of a new parameter. Encoding a whole URL leaves those delimiters alone, because escaping them would destroy the address structure. In JavaScript terms these are encodeURIComponent and encodeURI.

Which one do I want?

If you are building a query string and putting user text into one parameter, choose the single-value option. If you have a complete address that merely contains spaces or non-ASCII characters, choose the whole-URL option. Getting this backwards is the most common URL-encoding bug there is.

Why does a space sometimes become + instead of %20?

Plus is used specifically in application/x-www-form-urlencoded data, the format HTML forms post in. In a URL path or a modern query string, %20 is correct. This tool always produces %20, which is valid everywhere; if you are decoding old form data, convert plus signs to spaces first.

Why does decoding fail with an error?

Because the input is not valid percent-encoding. Usually there is a bare % that is not followed by two hexadecimal digits — a literal percent sign must itself be written as %25. The tool reports this rather than returning mangled text.

Does it handle non-English characters?

Yes. Text is encoded as UTF-8 first, which is what the URL standard requires, so Sinhala, Arabic, Chinese and emoji all round-trip exactly.

Is my data uploaded?

No. The conversion runs in your browser. That matters here because URLs frequently carry tokens, session identifiers and search terms.