URL Encoder & Decoder - Encode Query Strings Online
Encode or decode URLs, query parameters, and special characters instantly. Parse URL components and convert between encoded and decoded formats.
Frequently Asked Questions
What is URL encoding?
URL encoding (also called percent-encoding) converts characters into a format that can be safely transmitted in URLs. Characters that have special meaning in URLs or are not allowed (like spaces, &, ?, =) are replaced with a percent sign followed by their hexadecimal value. For example, a space becomes %20 and @ becomes %40.
When should I use URL encoding?
Use URL encoding when: passing user input as URL query parameters, including special characters in URL paths, submitting form data via GET requests, creating API request URLs with dynamic values, or encoding non-ASCII characters (like Korean or emoji) in URLs. It ensures your URLs are valid and parsed correctly by browsers and servers.
What's the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes almost all characters except A-Z, a-z, 0-9, and - _ . ! ~ * ' ( ). Use it for encoding query parameter values. encodeURI preserves URL structure characters like : / ? # @ and is used for encoding complete URLs while keeping them functional. Use encodeURIComponent for values, encodeURI for full URLs.
Should spaces be encoded as %20 or +?
Both are valid but used in different contexts. %20 is the standard RFC 3986 encoding for spaces in URLs. The + sign is used in application/x-www-form-urlencoded format (HTML form submissions). Modern web APIs typically expect %20, while form data traditionally uses +. This tool supports both options.
Is URL encoding secure?
URL encoding is not encryption - it's just a way to represent characters safely in URLs. Your data is still readable after decoding. This tool processes everything in your browser, so your data never leaves your device. For sensitive data, always use HTTPS and proper authentication.
Code Examples
// Encode query parameter value
const encoded = encodeURIComponent('hello world & more');
console.log(encoded); // "hello%20world%20%26%20more"
// Decode
const decoded = decodeURIComponent(encoded);
console.log(decoded); // "hello world & more"
// Encode full URL (preserves structure)
const url = encodeURI('https://example.com/path?q=hello world');
console.log(url); // "https://example.com/path?q=hello%20world"