URL encode / decode

URL encode / decode

Percent-encoding for URLs and query values

Computed in your browser

Choose parameter-value mode for individual values or full-address mode for a whole URL. Reserved characters such as / and ? behave differently.

Example

Input

a+b c/中文

Example result

a%2Bb%20c%2F%E4%B8%AD%E6%96%87

This example uses component mode. Ordinary decoding does not turn + into a space.

Technical details & limits

Each %HH sequence represents a byte of UTF-8 data. Full-URL mode preserves structural characters such as : / ? #, while component mode encodes them. JavaScript encodeURIComponent still leaves ! ' ( ) * unchanged, so it is not a complete strict RFC 3986 signature-canonicalization procedure.

About this tool

Percent-encode or decode a query value or a complete URL. Separate encodeURIComponent and encodeURI modes help handle Unicode, spaces, plus signs, slashes and nested callback parameters.

Use cases

  • Splice a query value that contains spaces, non-ASCII text or special chars into a URL.
  • Figure out why your server saw `%20` or `%25` in a parameter it did not expect.
  • Paste a valid curl / Postman command into documentation.

How to use

  1. Paste the URL or value into the input.
  2. Pick encoding granularity: encodeURIComponent (default, safer) or encodeURI (keeps :/?#).
  3. Click Encode or Decode, then copy the result.

Input & output

Input
Any UTF-8 string; a valid percent-encoded sequence for decoding.
Output
A percent-encoded string, or the decoded original.

Notes

encodeURIComponent is the safe default for anything that is not a complete URL (query values, path segments).

FAQ

How should I percent-encode Chinese URL parameter values?
Use parameter-value mode to percent-encode Chinese text intended for an individual URL parameter. Each UTF-8 byte becomes a percent sign followed by 2 hexadecimal digits, and a common Chinese character occupies 3 bytes. Encode the value separately from the surrounding address. Encoding the entire address in parameter mode also escapes structural separators, which can prevent the resulting URL from being interpreted as intended.
Why does URL decoding leave a plus sign unchanged?
Ordinary URL decoding does not automatically interpret a plus sign as a space. A space is commonly encoded as %20, while a literal plus can be encoded as %2B. Form encoding has a separate convention that uses plus signs for spaces. Check how the sending application serialized the parameter before replacing characters, because indiscriminate replacement can change literal data that was meant to remain a plus.
Why does encoding a URL twice produce percent-25 sequences?
Repeated URL encoding escapes an existing percent sign as %25, adding another encoding layer. For example, %20 becomes %2520 when encoded again and needs the corresponding decoding steps to recover the original space. Determine how many encoding layers actually occurred before decoding repeatedly. A percent sequence may be intentional text, so removing every possible layer can change data rather than simply restore the intended parameter.

Related tools

URL encode / decode · Percent-encoding for URLs and query values
URL encode / decode — Tool illustration · dayeku.com