URL Encode / Decode

URL-encode special characters as percent-escapes (%20 etc.) or decode them back. Auto-detects direction. Useful for query parameters, redirects, and reading messy URLs.

Example: hello world?hello%20world%3F

URL encoding (percent-encoding) replaces characters that have special meaning in URLs with % followed by their hex byte value. ? becomes %3F, space becomes %20, and so on. This is required when including arbitrary text in URL query parameters or path segments.

The tool auto-detects: if the input contains %xx sequences, it decodes; otherwise it encodes.

How the encoding works

This tool implements percent-encoding as defined in RFC 3986. Each character is first encoded as a byte sequence using UTF‑8. Characters that are not in the unreserved set (A-Z a-z 0-9 - . _ ~) are replaced with a % followed by two uppercase hexadecimal digits representing the byte value. For example, ? (U+003F) becomes %3F, and space (U+0020) becomes %20. Non‑ASCII characters, such as é, are first converted to their multibyte UTF‑8 representation: é (U+00E9) becomes %C3%A9.

The tool auto-detects the operation direction: if the input contains a % followed by two hex digits (case‑insensitive), it assumes decoding; otherwise, it assumes encoding. During decoding, each valid %XX sequence is converted back to the corresponding byte, and the byte sequence is interpreted as UTF‑8. Invalid sequences (e.g., %GG) are passed through unchanged. This robust handling ensures both clean URLs and raw form data are processed correctly.

How to use this encoder

  1. Paste or type the text you want to encode or decode into the input area.
  2. Choose the direction: Encode, Decode, or leave Auto-detect (default).
  3. Click the Convert button to perform the transformation.
  4. Copy the output result from the output area.

Edge cases worth knowing

Invalid % sequences
Inputs like `%GG` during decoding are left as-is because `GG` is not a valid hex pair.
Mixed content
If input contains both literal `%` and encoded sequences (e.g., `%20%`), auto-detect may misinterpret; use explicit mode for reliability.
Unicode surrogate pairs
Characters like emoji (e.g., 😀) are encoded as the UTF‑8 bytes of their full code point, not as surrogate pairs, in compliance with modern URL standards.

Encoding pro tips

  • For quick debugging of URL query strings, paste the entire URL and let auto-detect decode it in one click.
  • Always encode the full query parameter value, not just the keys, to avoid broken links.
  • When decoding, verify the output encoding is UTF-8 if your text contains non-ASCII characters.
  • Use the Encode mode explicitly if your input contains legitimate `%` that is not part of encoding (e.g., percentages in text).

vs other encoders

While many tools offer URL encoding, this one emphasizes simplicity and auto-detection.

This toolOnline URL Encoder/Decoder (urlencoder.org)Python urllib.parse.quote()
DetectionAuto-detects encode vs. decode based on % patternsNo detection; manual selectionNo detection; separate functions
Offline useNo (web-based)No (web-based)Yes (local script)
Batch handlingSingle input onlySingle input onlyCan process lists with loops

A bit of history

Percent-encoding originated with the development of the World Wide Web. RFC 1738 (1994), authored by Tim Berners‑Lee, first standardized the use of %XX escapes to include arbitrary octets in URLs. The current specification, RFC 3986 (2005), refined the rules and clarified the use of UTF‑8 for non‑ASCII characters. The automatic decode detection is a convenience feature not part of any standard but widely adopted in developer tools.

When to use this encoding

Building search query URLs

Encode user input before pasting into a URL: "hello world" → "hello%20world". Required for any query string with spaces or punctuation.

Reading messy URLs from logs

URLs in server logs are percent-encoded. Decoding makes them readable — you can see what the user actually searched for.

Debugging redirect URLs

OAuth and SAML flows pass redirect URLs as encoded query params. Decoding shows the actual destination.

Sharing URLs with special characters

If you want to share a URL with parentheses or non-ASCII characters and need it to survive copy-paste, encode it first.

Building Mailto / SMS links

mailto: and sms: URLs need encoded subject lines and bodies. Encode the message text before assembling.

Encoding FAQ

encodeURI vs encodeURIComponent — which does this use?

encodeURIComponent — encodes everything that's special, including ?, =, &, /. Use it when encoding a single value to put inside a URL. Use the broader encodeURI when encoding a whole URL.

Why are spaces sometimes encoded as + instead of %20?

In query strings (the part after ?), the legacy form-encoding standard uses + for space. Both are valid in query strings; %20 is universal everywhere else.

Does it encode UTF-8?

Yes — non-ASCII characters are encoded as their UTF-8 bytes (e.g. é → %C3%A9). This is the modern standard.

Will it double-encode an already-encoded string?

If your input contains %xx patterns, the tool assumes it's already encoded and decodes. To force re-encoding, paste cleaner input or run twice manually.

Embed our tools on your website

Free for any site. No signup. Iframe loads from our servers and stays up-to-date automatically.

📋 Embed the Word Counter

Copy this snippet:

Live preview:

📋 Embed this URL Encode / Decode

Copy this snippet:

Live preview:

Want more options? All embeddable tools →