URL Encode/Decode
Encode URLs to make them safe for transmission or decode percent-encoded URLs back to their readable form. Perfect for handling special characters in URLs, query parameters, and API endpoints.
URL to Encode
Enter a URL with special characters to encode for safe transmission
Example URLs:
Encoded URL
Your URL with special characters percent-encoded
Understanding URL Encoding
What is URL Encoding?
URL encoding (percent encoding) converts special characters into a format that can be safely transmitted over the internet. It replaces unsafe characters with a % followed by two hexadecimal digits.
Common Use Cases
- Encoding query parameters with special characters
- Building API endpoints with dynamic data
- Handling form submissions with special characters
- Creating safe URLs for email and messaging
- Working with international characters in URLs
Character Examples
Original:
Space: " "
Ampersand: &
Question: ?
Hash: #
Encoded:
%20
%26
%3F
%23
URL Structure
https://
example.com
/path/to/resource
?param1=value1¶m2=value2
#fragment
Different parts of a URL may require different encoding strategies.
Best Practices
- Always encode user input before adding to URLs
- Use appropriate encoding for different URL components
- Be careful with double-encoding issues
- Test URLs with international characters
JavaScript Examples
// Encode a URL component
const encoded = encodeURIComponent('hello world');
// Result: 'hello%20world'
// Decode a URL component
const decoded = decodeURIComponent('hello%20world');
// Result: 'hello world'
Frequently Asked Questions
Common questions about URL encoding and decoding.