URL Encode & Decode
Encode or decode URLs and query strings safely - privacy-first & browser-based
URL Encoder and Decoder Online
Encode and decode URLs, query strings, and parameters instantly. This URL encoder keeps unsafe characters safe, highlights problems, and handles Unicode with correct percent encoding.
This page is the canonical URL encoder/decoder for DevTools360 and is updated regularly to match current web standards.
How to Encode or Decode a URL
- Paste input: Add a full URL or just a query parameter.
- Auto-detect: The tool suggests encode or decode.
- Convert: Click Encode/Decode to update the output.
- Copy: Use the result in APIs, redirects, or forms.
Example URL Encoding
Input text:
hello world & filters=activeEncoded output:
hello%20world%20%26%20filters%3DactiveWhy URL Encoding Matters
URL encoding is crucial for web development and API integration. Without proper encoding, URLs can become invalid, break redirects, cause security vulnerabilities, and fail to transmit data correctly. When building APIs, handling redirects, or passing user input in URLs, proper encoding prevents errors and ensures data integrity. Our tool helps developers avoid common encoding mistakes that can lead to broken links, failed API requests, and security issues.
Common URL Encoding Errors
- Double encoding: %2520 is often a sign of encoding twice.
- Wrong function: Use encodeURIComponent for parameter values.
- Unescaped characters: Encode spaces, ampersands, and equals signs.
- Unicode handling: Ensure UTF-8 percent encoding for emojis.
How URL Encoding Works
URL encoding works by converting unsafe characters into percent-encoded sequences. Each unsafe character is replaced with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code. For example, the space character (ASCII 32, which is 20 in hexadecimal) becomes %20. Unicode characters are first converted to UTF-8 bytes, then each byte is percent-encoded. This ensures that URLs remain valid ASCII strings while supporting international characters.
Common Use Cases
- API Requests: Encoding query parameters and form data in REST APIs, GraphQL queries, and webhooks
- URL Redirects: Safely encoding user input and dynamic values in redirect URLs
- Query Strings: Encoding parameter values in URL query strings (e.g., ?search=hello%20world)
- Form Submissions: Encoding form data sent via GET requests or URL-encoded POST bodies
- OAuth & Authentication: Encoding callback URLs, state parameters, and authorization codes
- File Paths: Encoding file names and paths in URLs
- Email Links: Encoding email addresses and subject lines in mailto: URLs
- Social Media Sharing: Encoding URLs and text for sharing on social platforms
encodeURI vs encodeURIComponent
JavaScript provides two functions for URL encoding, each with different use cases:
- encodeURI: Encodes entire URLs while preserving characters that are valid in URLs (like :, /, ?, #, [, ]). Use this when encoding a complete URL that you want to keep functional.
- encodeURIComponent: Encodes individual URL components (like query parameter values) and encodes more characters, including :, /, ?, #. Use this when encoding values that will be inserted into specific parts of a URL.
Our tool uses encodeURIComponent, which is the correct choice for encoding query parameters, form values, and other URL components. This ensures maximum compatibility and prevents encoding-related bugs.
Common Mistakes in APIs and Redirects
Developers often encounter these URL encoding pitfalls:
- Double Encoding: Encoding already-encoded strings, resulting in sequences like %2520 instead of %20
- Forgetting to Encode: Passing unencoded user input directly in URLs, causing broken links or security issues
- Wrong Function: Using encodeURI instead of encodeURIComponent for query parameters, leading to invalid URLs
- Encoding Entire URLs: Encoding complete URLs instead of just the components that need encoding
- Redirect Issues: Not encoding redirect URLs properly, causing redirect failures or open redirect vulnerabilities
- Special Characters: Not handling Unicode, emojis, or special characters correctly in URLs
Our tool helps prevent these issues by auto-detecting whether input is encoded or decoded, validating encoding sequences, and highlighting unsafe characters that need encoding.
Unicode and International Character Support
Our URL encoder/decoder fully supports UTF-8 encoding, which means it can handle Unicode characters including emojis, international characters, Chinese, Japanese, Arabic, Cyrillic, and other special symbols. Unicode characters are first converted to UTF-8 bytes, then each byte is percent-encoded. This ensures that international text is properly encoded and can be safely transmitted in URLs while maintaining compatibility with systems that expect ASCII URLs.
Privacy and Security
All URL encoding and decoding operations happen entirely in your browser using JavaScript. Your data never leaves your device, is never sent to any server, and is never stored. This privacy-first approach ensures that sensitive information like API keys, authentication tokens, user data, or confidential URLs remains completely private and secure. Whether you're encoding passwords, API parameters, or redirect URLs, your data stays local and secure.
Related Workflows and Tools
- Base64 encoder/decoder for safe data encoding.
- Regex tester to validate URL patterns.
- JSON viewer for decoding URL-encoded JSON.
Standards and References
About This Tool
Maintained by the DevTools360 team. Last updated: 2026-01-15. We focus on accurate percent-encoding for modern web and API workflows.
Related Tools
Explore other developer tools from DevTools360:
- JSON Viewer - Free online JSON viewer, formatter, validator, and minifier.
- JWT Decoder - Free online JWT decoder and verifier.
- JSON to YAML Converter - Free online JSON to YAML converter.
- JSON to CSV Converter - Free online JSON to CSV converter.
- JSON to XML Converter - Free online JSON to XML converter.
- Base64 Encode & Decode - Free online Base64 encoder and decoder.
- Unix Timestamp Converter - Free online Unix timestamp converter.
- UUID Generator - Generate UUIDs instantly for databases and APIs.
- Regex Tester - Test and debug regular expressions in real time.
- Cron Expression Generator - Generate and understand cron expressions easily.
- Webhook Tester - Free online webhook testing tool.