About URL Encoder
URL encoding, also called percent-encoding, replaces characters that are not allowed in a URL with a percent sign followed by two hexadecimal digits for each of their UTF-8 bytes, as defined in RFC 3986. This tool uses the browser function encodeURIComponent, or encodeURI when you keep the URL structure, and decodeURIComponent for decoding. When decoding, plus signs are treated as spaces, as in form submissions.
How to use URL Encoder
- Type or paste into the "Input text" box, or press "Use example" to try it with sample data.
- Set "Direction" and "Keep URL structure" if the defaults do not fit.
- The result appears below and updates as you type.
- Copy the result with the copy button, or download it as a file where that is offered.
Questions about URL Encoder
What is the difference between encodeURI and encodeURIComponent?
encodeURI leaves characters that have a meaning in a URL, such as colon, slash, question mark, and ampersand, untouched. encodeURIComponent escapes those too, which is what you want for a single query parameter value.
Why is a space written as %20 in some places and as a plus sign in others?
The code %20 is the percent-encoding of a space and is valid anywhere in a URL. The plus sign is an older convention used only in form data and query strings. This tool outputs %20 and accepts both when decoding.
Runs in your browser. Page last updated .