What is URL encoding?
A URL can only contain a limited set of characters. Spaces, accented letters, emoji and symbols such as & or = have to be written as percent-encoded sequences: a % sign followed by two hexadecimal digits for each byte. A space becomes %20, and ñ, which takes two bytes in UTF-8, becomes %C3%B1.
This encoder has two modes, because what you need depends on what you are encoding. “Parameter value” works like JavaScript’s encodeURIComponent: it also encodes characters that have a meaning in a URL, such as & = ? / and :, so you can put any text, or even another URL, inside a single query parameter. “Full URL” works like encodeURI: it keeps the characters that give a URL its structure (: / ? & = #) and encodes only what is not allowed, which is what you want when you have a whole address with spaces or accents in it.
An extra option writes spaces as + instead of %20, the application/x-www-form-urlencoded format used by HTML forms. Encoding always uses UTF-8. The whole text box is encoded as one item, and everything runs in your browser.
How to URL encode text
- Paste the text or URL into the box.
- Choose “Parameter value” to encode a single value, or “Full URL” to encode a complete address.
- Turn on “Spaces as +” if the value is going into a form-style query string.
- Copy the encoded result.
When to use it
- Putting a search term with spaces or accents into a query string.
- Passing a full URL as the value of a parameter, for example a redirect or share link.
- Building API requests or test URLs by hand.
- Fixing a link that breaks because it contains spaces or non-ASCII characters.
- Checking how a string will look once a browser or library encodes it.
encodeURI vs encodeURIComponent
- encodeURIComponent (“Parameter value” mode) encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for one value: https://a.com/?u=https%3A%2F%2Fb.com%2Fx%3Fy%3D1
- encodeURI (“Full URL” mode) keeps : / ? & = # and other reserved characters. Use it on a whole address: https://a.com/my page?q=café → https://a.com/my%20page?q=caf%C3%A9
- Rule of thumb: encode each value with encodeURIComponent, then join the URL. Running encodeURI on a value that contains & or = will break your query string.
%20 or +?
Both can mean a space in a query string. %20 is valid anywhere in a URL; + means a space only in form-encoded query strings (application/x-www-form-urlencoded). In the path, + is a literal plus sign. If you are unsure, use %20.
Frequently Asked Questions
Which mode should I use?
Use “Parameter value” for a single value that goes after = in a query string, especially if it contains &, =, ? or / or is itself a URL. Use “Full URL” when you have a complete address and only want to fix spaces and special characters without breaking its structure.
What character encoding is used?
UTF-8, the standard for URLs. Characters outside ASCII take several bytes, so ñ becomes %C3%B1 and an emoji becomes four %XX sequences.
Should spaces be %20 or +?
By default spaces become %20, which works everywhere. Turn on “Spaces as +” only for form-style query strings that expect that format.
Is my text sent to a server?
No. Encoding happens in your browser and the text does not leave your device.
Can I encode several values at once?
The whole text box is encoded as one item. The free try covers one run; ToolStudio Pro gives you unlimited use of this and every other tool for €1.99 a month, with no ads, cancel anytime.
How do I reverse it?
Use the URL decoder, which turns %XX sequences back into readable text.