When to use URL encoding
Special characters in URL parameter values may require percent encoding. This tool uses the JavaScript encodeURIComponent and decodeURIComponent functions, designed for individual URL components rather than encoding an entire URL as a single component.
Frequently asked questions
When should I URL-encode a value?
When a parameter value or path segment contains spaces, &, ?, #, accented letters or other characters with special meaning in URLs.
Should I encode a full https:// URL?
Usually not. The tool uses encodeURIComponent for one URL component or parameter value; applied to a full URL it also encodes : and /.
How is a space encoded?
encodeURIComponent encodes a space as %20. The + symbol is often used in application/x-www-form-urlencoded forms, but is not a universal substitute for %20 in every URL component.
Why does decoding sometimes fail?
An invalid or incomplete percent-encoded sequence, such as % or %2, cannot be decoded by decodeURIComponent.