Tools
URL encode
URL encode text
Encode text so it can be used safely in a URL or query parameters.
About this tool
A URL only allows a limited set of characters. Put a space, an accented letter, an & or a ? inside a parameter value and the link breaks or the server misreads it. Percent-encoding replaces those characters with sequences such as %20 or %C3%A9. You’ll need it when building UTM-tagged links, pre-filled searches, WhatsApp or mailto links with a message, or API calls.
Type or paste your text into “Text to encode” and the encoded result appears below straight away. Copy it with “Copy output” and paste it as the parameter value, after the =. Encode each value on its own rather than the whole URL: if you paste a full https://… address, the slashes and colon will be encoded too. “Switch to decode” gives you the original text back.
It uses JavaScript’s encodeURIComponent, the standard way to encode parameter values, and runs in your browser without sending anything. Non-ASCII characters are encoded as UTF-8, as browsers expect. Note that spaces come out as %20 rather than +, which is the other convention used by HTML forms.
Frequently asked questions
What is the difference between %20 and + for a space?
%20 is the standard encoding for a space anywhere in a URL. A + only means a space in form data (application/x-www-form-urlencoded); most servers accept both in a query string, but %20 is the safer choice.
Which characters are left unencoded?
encodeURIComponent leaves A–Z, a–z, digits and - _ . ! ~ * ' ( ) as they are. Everything else, including / ? & = #, and spaces, becomes %XX.
Do I need to encode UTM parameters?
Yes, if they contain spaces, accents or other symbols. For example, utm_campaign=autumn sale should be written utm_campaign=autumn%20sale so your analytics records it properly.
Why does é turn into two codes, %C3%A9?
Because in UTF-8 that character takes two bytes, and each byte is written as a %XX. Emoji take four bytes and produce four sequences.