Enter the required information
Use the fields in the tool above and keep units and formats consistent.
Encode spaces, ampersands and special characters in URLs, or decode percent-encoded links back to plain text. Handy for UTM tags and API query strings.
A campaign link like ?utm_campaign=Diwali Sale & Offers will not survive a click. The space ends the URL in some apps, and the & starts a new parameter. URL encoding, also called percent-encoding, replaces such characters with a % sign and two hex digits.
This URL encoder and decoder converts text to its safe percent-encoded form and back. Paste a messy query value to encode it, or paste a link full of %20 and %2F to read it.
| Character | Encoded | Why it needs encoding |
|---|---|---|
| Space | %20 (or + in form data) | Not allowed in URLs |
& | %26 | Separates query parameters |
= | %3D | Splits a key from its value |
? | %3F | Starts the query string |
/ | %2F | Separates path segments |
# | %23 | Starts a page fragment |
% | %25 | Marks an encoded byte |
| Rs symbol (U+20B9) | %E2%82%B9 | Non-ASCII, sent as 3 UTF-8 bytes |
Letters, digits and - _ . ~ never need encoding. These are the "unreserved" characters in RFC 3986.
JavaScript offers two functions, and picking the wrong one is a classic bug. encodeURI is meant for a full URL. It leaves / ? & = # untouched so the address still works. encodeURIComponent is meant for a single value. It encodes those characters too.
Rule of thumb: build the URL structure yourself, then run each parameter value through encodeURIComponent. Encoding a whole URL with the component version turns https:// into https%3A%2F%2F, which no browser will open.
If you see %2520, the text was encoded twice. The first pass made a space into %20. The second pass encoded the % as %25. Decode once, check the result, and encode only once.
Raw value: Diwali Sale & Offers
Encoded value: Diwali%20Sale%20%26%20Offers
The link then carries utm_campaign=Diwali%20Sale%20%26%20Offers, and your analytics tool reports the full campaign name.
Developers in other languages have their own helpers. Python offers urllib.parse.quote, PHP has rawurlencode and Java uses URLEncoder.encode. Note that Java's version turns spaces into +, which suits form data more than paths.
For SEO, keep page slugs to lowercase letters, numbers and hyphens. Such slugs need no encoding, read cleanly in search results and are easy to share. Google handles encoded non-English URLs, but plain slugs are simpler to manage.
For a quick check before you publish a tracking link, run the value through the ToolsMate URL encoder. Then test the final link in a private window to confirm it lands where you expect.
Use the fields in the tool above and keep units and formats consistent.
Review the result shown in the output area.
Confirm that the result matches your situation before using it for a decision.
URL components are encoded with encodeURIComponent.This describes the core logic used by the tool. Check any assumptions that may affect your result.
Use accurate inputs and keep units consistent.
Review the assumptions before using the result for a decision.
Compare important results with an independent or official source.
Use %20 in URL paths and in most query strings. The plus sign means a space only in form data sent as application/x-www-form-urlencoded. Many servers accept both in queries, but %20 is the safer, more widely understood choice.
That pattern means the URL was encoded twice. A space first became %20, then the percent sign itself was encoded as %25. Decode the string once and make sure your code applies encoding only a single time.
Uppercase and lowercase letters, digits, hyphen, underscore, full stop and tilde are unreserved, so they never need encoding. Reserved characters such as slash and question mark only need encoding when used as data rather than structure.
Yes, encode each UTM value if it contains spaces, ampersands, hash signs or non-English characters. Otherwise analytics tools may cut the campaign name short or split it into extra parameters, which spoils your reporting data.
No, they solve different problems. URL encoding uses percent signs for characters in web addresses. HTML encoding uses named entities that start with an ampersand. These let characters display safely inside a page.
Use urllib.parse.quote for a single value, or urllib.parse.urlencode to build a whole query string from a dictionary. Pass safe='' to quote when you also want slashes encoded, for example inside a redirect parameter.
Yes, non-ASCII characters are first converted to UTF-8 bytes, and each byte is then percent-encoded. A single Devanagari letter usually becomes three encoded bytes, so encoded Hindi text looks much longer than the original.
Explore other useful tools across the site.