URL Encoder / Decoder
Encode and decode URLs, URL components, and parse query parameters. Perfect for web development, API testing, and debugging.
Full URL (preserves /,?,:,@,&,=,+,$,#)
Example: https://example.com/search?q=hello world&lang=en
What is URL Encoding?
URL encoding (also known as percent encoding) is a method to encode special characters in URLs. Since URLs can only contain a limited set of ASCII characters, any character outside this set (spaces, special characters, non-ASCII characters) must be encoded using a percent sign (%) followed by hexadecimal digits.
This tool supports both encodeURI (for full URLs) and encodeURIComponent (for URL components like query parameters). It also includes a query parameter parser to easily view and edit URL parameters.
How to Use This Tool
Encoding URLs
- Select encoding mode (Full URL or Component)
- Enter your URL or text in the input field
- Click "Encode" button
- Copy the encoded output
Decoding URLs
- Paste your encoded URL in the input field
- Select appropriate decoding mode
- Click "Decode" button
- View the decoded result
Query Parameters
- Switch to "Query Parameters" mode
- Parse existing query string or add parameters manually
- Edit parameters in the list
- Copy the generated query string
Encoding Modes
- Full URL: Preserves URL structure characters
- Component: Encodes all special characters
- Use "Swap" to quickly switch input/output
encodeURI vs encodeURIComponent
encodeURI (Full URL Mode)
Use when encoding a complete URL. It preserves characters that have special meaning in URLs like :, /, ?, #, and &.
Output: https://site.com/path%20name
encodeURIComponent (Component Mode)
Use when encoding URL components like query parameters. It encodes ALL special characters including :, /, ?, #, and &.
Output: hello%26world%3Dtest
Common Encoded Characters
Common Use Cases
1. API Query Parameters
When building API requests, query parameters often contain special characters that need encoding. For example, search terms with spaces, ampersands, or special characters must be properly encoded to avoid breaking the URL structure.
2. Search Engine URLs
Search queries frequently contain spaces and special characters. URL encoding ensures that search terms are transmitted correctly. Google, Bing, and other search engines require proper URL encoding for accurate results.
3. Form Submissions with GET Method
When submitting forms via GET requests, form data is encoded into the URL. Special characters in form fields (names, addresses, comments) must be URL-encoded to prevent data corruption and security issues.
4. Social Media Sharing Links
When creating shareable links for social media (Twitter, Facebook, LinkedIn), you often pass URLs, titles, and descriptions as parameters. These need proper encoding to ensure they display correctly when shared.
5. OAuth and Authentication Callbacks
OAuth redirect URLs often contain encoded parameters. When implementing authentication flows, callback URLs with query parameters must be properly encoded to prevent authentication failures and security vulnerabilities.
6. Debugging and Development
Developers frequently need to decode URLs from logs, network traces, or error messages to understand what data is being transmitted. This tool helps quickly decode obfuscated URLs during debugging sessions.
Frequently Asked Questions
When should I use encodeURI vs encodeURIComponent?
Use encodeURI when encoding an entire URL (it preserves ://, /, ?, &). Use encodeURIComponent when encoding individual URL components like query parameter values (it encodes ALL special characters including /, ?, &).
Why are spaces encoded as %20 or +?
Both are valid. %20 is the standard percent-encoding for spaces and works everywhere. The + encoding is specific to query strings (application/x-www-form-urlencoded). Modern practice prefers %20 for consistency.
Can URL encoding break my URLs?
Only if you encode the wrong parts. Never encode the entire URL including the protocol (https://). Only encode the parts that contain user input or special characters, typically query parameter values.
Is URL encoding the same as Base64 encoding?
No. URL encoding converts special characters to percent-encoded values (%20, %3A). Base64 encoding converts entire binary data into ASCII strings. They serve different purposes and are not interchangeable.
Does URL encoding provide security?
No. URL encoding is for compatibility, not security. It doesn't encrypt or protect data. Always use HTTPS for security, and never put sensitive data (passwords, tokens) in URLs, even if encoded.
What happens if I don't encode URLs?
Unencoded special characters can break URLs, cause parsing errors, or lead to security vulnerabilities like URL injection. Browsers may auto-correct some issues, but it's best practice to always properly encode user input in URLs.
Privacy & Security
All encoding and decoding happens entirely in your browser. Your URLs and data never leave your device. This tool runs 100% client-side for complete privacy and security.