About the URL Encoder
URLs can only contain a limited set of characters, so spaces, accents and symbols such as &, ? and # must be percent-encoded. The URL Encoder shows two versions:
- encodeURIComponent: encodes everything that is not safe inside a single query value or path segment. Use this for parameter values.
- encodeURI: leaves characters that structure a URL (: / ? & =) alone. Use this for a complete URL that already has the right structure.
How to use the URL Encoder
- Enter the text or URL.
- Copy the encodeURIComponent result for a parameter value, or the encodeURI result for a whole URL.
Example
A search query
“café & tea?” becomes caf%C3%A9%20%26%20tea%3F, safe to use as ?q=caf%C3%A9%20%26%20tea%3F.
Frequently asked questions
Why is a space %20 and not +?
%20 is the standard encoding everywhere in a URL. “+” means a space only in form-encoded query strings.
Which version should I use?
For values you insert into a URL, encodeURIComponent. Encoding a whole URL with it would also encode the slashes and colon.
Can I decode it again?
Yes, with the URL Decoder.