Stax
Tools

URL Encoder / Decoder

Encode or decode URLs and query strings with percent-encoding.

What is URL encoding?

URLs can only contain a limited set of characters. When you need to include spaces, punctuation, or non-ASCII characters (like ₹ or 中文) in a URL, they must be percent-encoded — replaced with %XX where XX is the hex value of the character.

This tool uses encodeURIComponent and decodeURIComponent — the same functions your browser and JavaScript use internally. It correctly handles Unicode, emoji, and multi-byte characters.

Common encoded characters

  • Space → %20
  • & → %26
  • = → %3D
  • ? → %3F
  • / → %2F
  • # → %23
  • + → %2B

Common use cases for URL encoding

Frontend developers encode query parameter values before appending them to API endpoints — a search query like "price ≥ ₹500" becomes price+%E2%89%A5+%E2%82%B9500 when passed as a URL parameter. Backend engineers decode incoming query strings to extract the original user-supplied values before processing. Content teams building UTM-tagged marketing URLs encode campaign names that contain spaces and special characters. Web scrapers decode percent-encoded URLs from sitemaps to recover human-readable page paths.

encodeURI vs encodeURIComponent — when to use which

Use encodeURI when encoding a complete URL — it preserves structural characters like /, ?, =, and & so the URL remains functional. Use encodeURIComponent when encoding a single query parameter value — it encodes everything including / and & so the value cannot accidentally break the URL structure. This tool uses encodeURIComponent, which is the safe default for parameter values. If you need to encode a full URL without breaking its structure, use encodeURI instead, available in any browser console.

Decoding garbled URLs

When you copy a URL from a browser address bar or API response and see sequences like %E2%82%B9, paste it into the decoder to see the original text ( in this case). Email clients and some CMS platforms double-encode URLs, turning %20 into %2520 — decode twice to recover the original. Log files from web servers typically store raw percent-encoded request paths; use this tool to decode them into readable form when debugging 404 errors caused by special characters in file paths.

Frequently asked questions

What is URL encoding?
URL encoding (also called percent-encoding) converts characters that aren't allowed in a URL into a safe format. Each unsafe character is replaced with a % sign followed by two hex digits. For example, a space becomes %20, and & becomes %26.
When do I need to encode a URL?
Whenever you include user input or special characters in a URL — query parameters, path segments, or form data. Characters like spaces, &, =, ?, #, and non-ASCII text (like ₹ or Hindi script) must be encoded to avoid breaking the URL structure.
What's the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL and leaves structural characters like / ? & = intact. encodeURIComponent (what this tool uses) encodes everything except letters, digits, and - _ . ! ~ * ' ( ) — making it safe for individual query parameter values.
Is my data sent to a server?
No. Encoding and decoding happen in your browser using JavaScript's built-in encodeURIComponent and decodeURIComponent functions. Nothing is uploaded.

Related tools