URL Encode & Decode
Encode or decode URL components, query strings, and full URIs instantly.
About this tool
URL encoding (percent encoding) replaces characters not allowed in URLs with a % sign followed by two hexadecimal digits. It ensures URLs are valid and correctly interpreted by browsers and servers.
Encoding query string parameters with special characters, building API request URLs, fixing broken URLs with spaces or unicode characters, and debugging URL parsing issues.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL and preserves /, ?, #, and &. encodeURIComponent encodes a URL component (like a query value) and encodes those characters too. Use encodeURIComponent for parameter values.
Why are spaces encoded as %20 and sometimes as +?
In the URL path, spaces must be %20. In query strings (application/x-www-form-urlencoded), spaces may be encoded as + for historical reasons. Both are valid in their respective contexts.
Which characters do not need encoding?
Unreserved characters are safe without encoding: letters A-Z a-z, digits 0-9, and the four symbols: - _ . ~