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

When to use encodeURI vs encodeURIComponent?
Use encodeURIComponent for values inside a URL (query, path segments). Use encodeURI only when you have a complete URL and want to keep its structural characters.
Why does decoding produce gibberish?
The input was not UTF-8 percent-encoded, or was truncated (trailing `%E4` with the next byte missing).
Should a space become `%20` or `+`?
This tool encodes spaces as %20. Form-urlencoded serialization uses + for spaces in form data or query strings following that convention. Ordinary URL decoding does not replace + automatically.
Why do I still see %20 after decoding?
The value may have been encoded twice: %2520 becomes %20 after one pass. Check how many encoding layers the data actually has before decoding again.
What if I encode an entire URL as a parameter value?
Colons, slashes and question marks are encoded too. The result can be placed inside another parameter but is no longer the original directly navigable URL. Choose the mode by context.

Related tools

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