Percent-encode / decode

Encode or decode a URL.

Paste text or a URL. Encode the whole URL with encodeURI or just the components with encodeURIComponent. Decode percent-escaped strings. Pure browser; no login.

Output

URL encoding, and which kind you need

A URL may only contain a limited set of characters. Spaces, accented letters, emoji and symbols that have a job in URL syntax, such as ? & = # and /, must be written as percent escapes: a % followed by two hex digits for each byte. A space becomes %20 and é becomes %C3%A9, its two UTF-8 bytes.

Getting this wrong breaks links in quiet ways. An unescaped & inside a search term splits it into two parameters, and an unescaped # cuts the rest of the URL off before it reaches the server. This tool offers both encoding styles JavaScript provides, plus decoding, and shows the difference instantly.

How to use it

  1. Pick a mode: Encode component, Encode full URL, or Decode.
  2. Paste your text or URL into the input box.
  3. Copy the result. Switch modes to compare how the same input comes out.
  4. If decoding fails, the input contains a % that is not followed by two valid hex digits, or bytes that do not form valid UTF-8.

Example: one input, two encoders

Input
https://example.com/search?q=café & bar
Output
Encode component: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dcaf%C3%A9%20%26%20bar
Encode full URL: https://example.com/search?q=caf%C3%A9%20&%20bar

Encode full URL keeps the & as it is, so a server would read the query as q=café and a second, empty parameter called bar. The right fix is to encode only the value café & bar as a component and then append it after q=.

Encode component or encode full URL?

Encode component (encodeURIComponent) escapes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for a single piece that goes inside a URL: one query value, one path segment, a redirect target passed as a parameter. This is the one you want most of the time.

Encode full URL (encodeURI) leaves the characters that give a URL its structure, such as : / ? & = and #, and only escapes spaces and characters outside ASCII. Use it to clean up a whole URL that is already correctly built but contains spaces or non-English letters.

Plus signs and spaces

HTML forms send spaces in query strings as + instead of %20, a format called application/x-www-form-urlencoded. The decoder here follows the URL standard and leaves + as a plus sign. If you are decoding form data and see words joined by +, replace them with spaces first.

Double encoding

Encoding text that is already encoded turns each % into %25, so %20 becomes %2520. If you see %25 in a broken link, something encoded the URL twice. Decode once and check the result before encoding again.

Questions

Is URL encoding a security measure?

No. It only makes text safe to place inside a URL. It does not hide or protect anything; anyone can decode it.

Why do some sites show Chinese or Arabic letters in the address bar?

Browsers decode percent escapes for display so URLs stay readable. What actually travels over the network is still the encoded form.

Does the tool open or fetch the URL?

No. It only transforms text in your browser and never makes a request to the address you paste.