URL Encoder / Decoder
Encode and decode URLs online. Convert special characters to URL-safe format for use in web addresses and API calls.
Input
Output
Common Use Cases
Email Address
user@example.com
Query with Spaces
hello world test
Special Characters
!@#$%^&*()+=[]{}|;:'",.<>?
URL with Parameters
https://example.com?name=John Doe&age=30
International Text
Hello 世界 مرحبا мир
File Path
/path/to/file name.txt
JSON String
{"name": "John", "age": 30}
HTML Content
<div class="test">Hello & Goodbye</div>
Web Safe
Convert special characters to URL-safe format for use in web addresses
Multiple Methods
Choose between standard, full URI, or custom encoding methods
Character Analysis
See exactly which characters need encoding and their encoded values
Query Builder
Parse and build query strings with automatic parameter encoding
When to Use URL Encoding
Query Parameters
Encode values passed in URL query strings to handle spaces and special characters
Form Data
When submitting forms with application/x-www-form-urlencoded content type
API Calls
Encode parameters in REST API URLs to ensure proper transmission
File Paths
Handle spaces and special characters in file paths within URLs
Code Examples
JavaScript
// Encode encodeURIComponent('hello world') // "hello%20world" // Decode decodeURIComponent('hello%20world') // "hello world"
Python
import urllib.parse # Encode urllib.parse.quote('hello world') # "hello%20world" # Decode urllib.parse.unquote('hello%20world') # "hello world"
PHP
// Encode urlencode('hello world'); // "hello+world" rawurlencode('hello world'); // "hello%20world" // Decode urldecode('hello%20world'); // "hello world"
Frequently Asked Questions
What's the difference between encodeURI and encodeURIComponent?
encodeURI()
is used to encode complete URIs and preserves characters that are valid in URIs (like :, /, ?, #).encodeURIComponent()
encodes all special characters and is used for encoding individual URI components like query parameter values. Use encodeURIComponent for query string values and encodeURI for complete URLs.