URL Encoder / Decoder
Encode or decode URLs and query strings with percent-encoding instantly in your browser — handles special characters and full URIs. Free, no sign-up.
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, per the percent-encoding rules in RFC 3986 (URI Generic Syntax).
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.
From the blog
- UTF-8, Unicode, and Character Encoding: What Every Developer Needs to Know
Why mojibake happens, how Unicode code points map to UTF-8 bytes, the difference between ASCII, Unicode, and UTF-8, and why 'just use UTF-8 everywhere' is correct advice but still requires understanding.
- URL Encoding Explained: Why Your Links Break and How Percent-Encoding Fixes Them
What percent-encoding actually is, which characters must be encoded in a URL and why, the difference between encodeURI and encodeURIComponent in JavaScript, and common bugs it causes in production.
- Base64 encoding explained: what it is, when to use it, and when not to
Base64 turns binary data into text so it can travel safely through text-only channels. Here's how it works, where it's used, and the mistakes developers commonly make with it.
Related tools
- Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to plain text instantly in your browser — no upload, no sign-up, and nothing leaves your device.
- Unicode Converter
Convert text to Unicode code points and back, and inspect the underlying UTF-8/UTF-16 byte representation. Free, instant, no sign-up.
- Text to Slug Generator
Convert any title or text into a clean, SEO-friendly URL slug instantly — lowercase, hyphenated, and ready to publish. Free, no sign-up.
- HTML Entity Encoder / Decoder
Encode HTML special characters into entities, or decode entities back to plain text, instantly in your browser. Free, no sign-up needed.