URL Encode/Decode
Encode and decode URLs with encodeURI and encodeURIComponent
encodeURI — leaves /?:@&=+$# intact
encodeURI preserves URL-structural characters: / ? : @ & = + $ #
encodeURIComponent encodes all special characters — use for query parameter values
What is URL Encoding?
URL encoding converts special characters in a URL into percent-encoded format (e.g., spaces become %20) so they can be safely transmitted over the internet. This tool supports both encodeURI (which preserves URL structure characters) and encodeURIComponent (which encodes everything), plus their decoding counterparts.
How to Use This URL Encoder/Decoder
- Select the mode: Encode URI, Decode URI, Encode Component, or Decode Component.
- Type or paste your URL or query string into the input area.
- The encoded or decoded result appears instantly in the output area.
- Use the copy button on either pane to copy the value to your clipboard.
Common Use Cases
- Encoding query parameter values containing special characters
- Decoding percent-encoded URLs for debugging or inspection
- Preparing URLs for embedding in HTML or JavaScript
- Testing API endpoints with encoded path segments
- Converting international characters (Unicode) for URL-safe transmission
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI preserves URL-structural characters like / ? : @ & = + $ #, making it suitable for full URLs. encodeURIComponent encodes all special characters and should be used for individual query parameter values.
Why do spaces become %20 instead of +?
The + encoding for spaces is specific to the application/x-www-form-urlencoded format used in HTML form submissions. Standard URL encoding uses %20 as defined by RFC 3986, which is what encodeURI and encodeURIComponent produce.
Can I encode a full URL with encodeURIComponent?
You can, but it will break the URL structure by encoding slashes, colons, and other delimiters. Use encodeURI for full URLs and reserve encodeURIComponent for individual parameter values.
Related Tools
Security
Password Generator
Generate strong passwords with customizable options and strength meter
Security
Hash Calculator
Calculate MD5, SHA-1, SHA-256, and SHA-512 hashes from text or files
Security
URL Encode/Decode
Encode and decode URLs with encodeURI and encodeURIComponent
Security
HTML Entity Encoder
Encode and decode HTML entities with named and numeric formats
Developer
JSON Formatter
Format, minify, and validate JSON with syntax highlighting
Developer
Base64 Encode/Decode
Encode and decode Base64 strings with URL-safe support