URL Encode / Decode

URL encode or decode text online using UTF-8 percent-encoding. Choose %20 (RFC 3986) or + (form encoding) for spaces.

URL parts

Part / parameter Value (decoded) Copy

What is URL encoding?

URLs may only contain a limited set of characters. Non-ASCII text, spaces and characters with a special meaning in URLs, such as &, = and ?, must be encoded before they go into a URL parameter. URL encoding (percent-encoding) converts each character to UTF-8 bytes and writes them as % followed by two hex digits; the Chinese character 中, for example, becomes %E4%B8%AD.

How to use

  1. Click "Encode" or "Decode" to choose the direction; the selected button stays highlighted.
  2. Type in the Input box. With "Auto convert" on, the result appears as soon as you stop typing.
  3. "Use result as input" moves the result to the left and flips the direction.

Should spaces become %20 or +?

Example

a b&c=中文 encodes to:

a%20b%26c%3D%E4%B8%AD%E6%96%87

How does this differ from JavaScript's encodeURIComponent?

The results are almost the same. Following RFC 3986, this tool also encodes the five characters !, ', (, ) and *, keeping only letters, digits, -, _, . and ~. That is less likely to cause problems on different servers.

Encoding scope and URL parsing

FAQ

Can I encode a whole URL?

With the default "Parameter value" scope, a whole URL breaks because ://, ? and & are encoded too. For a whole URL, set "Encoding scope" to "Full URL", which keeps the URL structure and encodes only what a URL does not allow; use "Parameter value" for a single value.

Decoding says "Invalid URL-encoded string"

Every % must be followed by two hex digits (0–9, A–F). If the text simply contains a percent sign (like 100%), it was never encoded and does not need decoding.

What does %2520 mean?

The text was encoded twice: the % itself was encoded again as %25. Decode once more to get the original.