Encode special characters in URLs to percent-encoded format, or decode them back — instantly in your browser.
Free URL Encoder Decoder | Encode & Decode URLs Online in 3 Seconds
Special characters in URLs break links, corrupt query strings, and cause APIs to reject requests. Our free URL encoder decoder converts any text or URL to a valid percent-encoded format — or decodes it back to readable plain text — instantly in your browser.
What Is URL Encoding?
URL encoding, also called percent encoding, is the process of converting characters that are not safe to use in a URL into a format that browsers and servers can reliably transmit. It replaces unsafe characters with a % sign followed by two hexadecimal digits representing the character’s ASCII code.
For example, a space becomes %20, & becomes %26, and @ becomes %40. The result is a URL that can travel through any system without being misread, truncated, or corrupted.
Without URL encoding, a query string like search?q=hello world&lang=en would break because the space and ampersand have special meanings inside a URL. With encoding it becomes search?q=hello%20world&lang=en — unambiguous and safe to transmit anywhere.
How to Use This URL Encoder Decoder
Step 1 — Choose your mode Click “Encode → %XX” to convert plain text or a raw URL to percent-encoded format. Click “Decode → Plain text” to reverse the process and turn a percent-encoded URL back into readable text. The swap button between panels flips both the content and mode in one click.
Step 2 — Choose your method encodeURIComponent encodes everything except letters, digits, and the characters - _ . ! ~ * ' ( ). Use this for encoding individual query parameter values. encodeURI is less aggressive — it leaves characters like /, ?, =, &, and # untouched, making it suitable for encoding a full URL where the structure must be preserved.
Step 3 — Choose space encoding %20 is the standard percent-encoded space used in URLs. + is an older convention used in HTML form submissions (application/x-www-form-urlencoded). Use %20 for modern APIs and URLs; use + only when submitting form data to legacy systems that expect it.
Step 4 — Paste your input Type or paste your text directly into the left panel. Output appears instantly on the right. The character highlighting panel below shows exactly which characters were encoded and what they became.
Step 5 — Copy your output Hit Copy to grab the result and paste it directly into your code, API client, or browser address bar.
encodeURIComponent vs encodeURI — Which Should You Use?
This is the most common source of confusion with URL encoding, so it is worth being precise.
Use encodeURIComponent when encoding a single value that will be placed inside a URL — a search query, a parameter value, a username, or any piece of data that is not itself a URL structure. It encodes everything that could be misread, including &, =, ?, /, and #. This is the right choice for the vast majority of URL encoding tasks.
Use encodeURI when encoding a complete URL where you want to preserve the URL structure. It leaves the structural characters (/, ?, =, &, #, :) unencoded because they are valid URL components. Use this when you have a full URL that contains some unsafe characters but you do not want to destroy its structure.
In practice: if you are building a query string or encoding a value to embed in a URL, always use encodeURIComponent. If you are encoding an entire URL before passing it somewhere, use encodeURI. For a full reference on which characters each method encodes, MDN’s encodeURIComponent documentation{target=”_blank” rel=”noopener”} and MDN’s encodeURI documentation{target=”_blank” rel=”noopener”} are the authoritative sources.
Common URL Encoding Use Cases
API query parameters — When building a URL with user-supplied data, always encode the values with encodeURIComponent. A search query containing & or = will break your query string if not encoded. q=name=John&age=30 becomes q=name%3DJohn%26age%3D30 — unambiguous and safe.
Redirects and callback URLs — When passing a URL as a parameter value inside another URL, the inner URL must be fully encoded. redirect=https://example.com/path?foo=bar becomes redirect=https%3A%2F%2Fexample.com%2Fpath%3Ffoo%3Dbar.
Email addresses in URLs — The @ symbol is reserved in URLs. An email address like [email protected] must be encoded as user%40example.com when used as a query parameter value.
File paths on different operating systems — Windows paths with backslashes and spaces (C:\Users\My Documents\) need encoding before they can appear in a URL.
Debugging encoded URLs — When you receive a percent-encoded URL and cannot read it, switch to decode mode and paste it in. The tool renders the decoded plain text and highlights what was encoded.
Frequently Asked Questions
What is a URL encoder decoder? A URL encoder decoder is a tool that converts text containing special characters into percent-encoded URL format (encoding), or converts a percent-encoded string back into human-readable plain text (decoding). Our free URL encoder decoder handles both directions instantly with support for encodeURIComponent, encodeURI, and both %20 and + space conventions.
What characters need to be URL encoded? Any character that is not a letter (A–Z, a–z), digit (0–9), or one of the unreserved characters (-, _, ., ~) must be encoded when used as a data value inside a URL. This includes spaces, &, =, ?, /, #, @, :, +, % itself, and all non-ASCII characters including accented letters, emoji, and characters from non-Latin scripts.
What is the difference between %20 and + for spaces? Both represent a space, but in different contexts. %20 is the standard percent-encoded space used in modern URLs and APIs. + is an older convention from HTML form submissions that only applies inside the query string of application/x-www-form-urlencoded data. When in doubt, use %20 — it is universally understood. Use + only when submitting form data to a system that explicitly expects it.
Why does my URL break when it contains special characters? Because special characters like &, =, ?, #, and / have structural meaning inside URLs. When they appear as data values, the browser or server interprets them as URL structure rather than content, breaking the URL. Percent-encoding replaces them with their %XX equivalents which have no structural meaning and can be transmitted safely.
Can I use this to encode an entire URL? Yes — switch to encodeURI mode, which leaves the structural characters of the URL intact while encoding any unsafe characters. If you use encodeURIComponent on a full URL, it will encode the slashes, colons, and question marks as well, breaking the URL structure.
What does %20 mean in a URL? %20 is the percent-encoded representation of a space character. The % indicates an encoded character, and 20 is the hexadecimal ASCII code for a space (32 in decimal). Similarly, %3A is a colon (:), %2F is a forward slash (/), and %40 is an at sign (@).
Is URL encoding the same as Base64 encoding? No. URL encoding (percent encoding) converts individual characters to %XX sequences and is used specifically to make text safe for use in URLs. Base64 encoding converts binary data to a text-safe string using a 64-character alphabet and is used for encoding binary data for transmission. They serve entirely different purposes. Use our Base64 Encoder Decoder if you need Base64.
More Free Tools from WebsOpener
- 🔗 Multiple URL Opener: Open hundreds of links at once in separate tabs
- 📊 UTM Parameter Builder: Build campaign tracking URLs for Google Analytics
- 🔤 URL Slug Generator: Turn any title into a clean SEO-friendly permalink
- 🔠 Base64 Encoder Decoder: Encode and decode Base64 strings and files
- ⚙️ Robots.txt Generator: Build and validate your robots.txt file visually
No account required. No data stored or transmitted. All processing happens locally in your browser.
