๐Ÿ”— URL Encode/Decode

Input
Output

Percent-encode (URL-encode) text or a URL, or decode it back. Useful for preparing a string to use inside a URL, or inspecting query parameters.

How to use

  1. Choose "Encode" or "Decode" mode.
  2. Choose the "Component" or "Full URL" scope.
  3. Paste your text or URL into the input box and click the run button.

How the calculation works

URLs may contain only letters, digits and a limited set of symbols. To include Japanese text, spaces or characters with special meaning, each character is converted to UTF-8 bytes and each byte written as "%" followed by two hex digits. This is percent-encoding, defined in RFC 3986. The tool has two modes. "Whole URL" uses JavaScript's encodeURI, which leaves characters that give a URL its structure โ€” "/", "?", "&", "=", "#", ":" โ€” alone and encodes everything else. "Component" uses encodeURIComponent, which encodes those symbols too. Use component mode when inserting text into part of a URL, such as a query parameter value; otherwise an "&" inside the value would be mistaken for a parameter separator.

Worked example

Encoding "ๆฑไบฌ & ๅคง้˜ช?x=1" in component mode %E6%9D%B1%E4%BA%AC%20%26%20%E5%A4%A7%E9%98%AA%3Fx%3D1 "ๆฑ" is three bytes in UTF-8, giving three groups, %E6%9D%B1; the space becomes %20 and & becomes %26. Encoding "https://example.com/ๆคœ็ดข?q=ๆฑไบฌ ๅคง้˜ช&page=1" in whole-URL mode encodes only the Japanese and the space, leaving "?", "=" and "&" intact.

Things to be aware of

  • Use component mode when encoding a query parameter value.
  • Form submissions may encode spaces as "+" (application/x-www-form-urlencoded). This tool encodes spaces as %20.
  • Decoding malformed percent-encoding (such as "%" not followed by two hex digits) produces an error.
  • Encoding an already encoded string turns "%" into %25, double-encoding it.

FAQ

Does the result differ between "component" and "full URL" modes?

Yes โ€” "component" mode encodes everything including / and &, while "full URL" mode preserves characters that are already valid in a URL. Choose based on what you need.

Can it encode URLs containing Japanese?

Yes โ€” multi-byte characters like Japanese are converted to UTF-8 percent-encoding.

How do I inspect the contents of a query string?

Paste the encoded query string into Decode mode to see it converted back to readable text.

Are spaces encoded as %20 or +?

Following standard percent-encoding, spaces are encoded as %20.

Is my input sent to a server?

No, encoding and decoding happen entirely in your browser and nothing is sent externally.