Tips:
- encodeURIComponent: Encodes all special characters, suitable for URL parameters
- encodeURI: Preserves URL structure characters (: / ? # etc.), suitable for complete URLs
About This Tool
URL encoding (also called percent-encoding) is a method to convert special characters into a format that can be safely transmitted in URLs. Non-ASCII characters and URL reserved characters are converted to percent sign (%) followed by two hexadecimal digits. This tool supports two encoding modes: encodeURIComponent for encoding URL parameters, and encodeURI for encoding complete URLs. It supports Chinese and various special character processing, all operations are done locally in your browser.
How to Use
- Select encoding mode: encodeURIComponent (recommended for URL parameters) or encodeURI (for complete URLs)
- Enter the content you want to encode in the 'Original Text' box
- Click 'Encode' button to perform URL encoding
- Or paste a URL encoded string in the 'Encoded Result' box
- Click 'Decode' button to restore original text
- Use 'Copy' button to copy results to clipboard
Common Use Cases
- URL parameter processing: Encode query string parameters
- Chinese links: Handle URL addresses containing Chinese
- Form submission: URL encode form data
- API calls: Build API requests containing special characters
- Redirect links: Encode redirect URLs
- Link sharing: Handle links containing spaces or special characters