Free tool URL decoder and URL encoder
Spaces, ampersands, accents and emoji cannot travel in a URL as they are. Encode a campaign name or a redirect link so it survives the trip, or decode a string full of %20 and %C3%A9 to see what it really says.
- Parameter value or full URL
- Updates as you type
- Runs locally
Encode or decode a URL
The sample is a campaign name that would break a link if pasted in raw. Switch the mode to compare, or paste your own text.
The whole box is processed at once, line breaks included.
Spring%20Sale%20%26%2050%25%20offEncoding writes spaces as %20. Characters outside ASCII become their UTF-8 bytes.
Share these inputs: the values go after the # in the link, so they never reach a server.
https://tapcub.com/tools/url-encoder-decoder
Version v1.0Updated Update history
Which mode to use, and how to read the output
The two encode modes differ only in which punctuation they leave alone. Picking the wrong one is the most common URL bug.
Parameter value
Uses encodeURIComponent. Everything except letters, digits and - _ . ! ~ * ' ( ) is encoded, including &, =, ?, / and #. Use it for one value you are about to put after =, such as a campaign name, a search term or a redirect URL.
Full URL
Uses encodeURI. It keeps the characters that give a URL its structure (: / ? & = # and a few more) and encodes spaces and non-ASCII text. Use it to clean up a whole link that contains spaces or accented characters, not to encode a value.
Decode
Turns every %XX back into its character. With "+ as a space" on, a + becomes a space first, which is how HTML forms encode spaces; an encoded plus sign is %2B and still decodes to +.
Reading %XX
Each %XX is one byte in hexadecimal. ASCII characters take one byte, so a space is %20. An accented letter takes two (é → %C3%A9), a Chinese character three, and most emoji four.
Decoding a whole URL is for reading it. Do not paste the decoded version back as a link: an encoded & or = inside a value is now a real separator, and the link means something else.
Three steps
Encode before a value goes into a link; decode when you need to read one.
-
1
Pick the mode
Parameter value for anything after
=; full URL for a whole link with spaces in it; decode for a string full of%signs. -
2
Paste the text
The result updates as you type. For decoding, leave "+ as a space" on unless the text contains plus signs that must stay.
-
3
Copy and check
Copy the result from the code block. To double-check an encoding, switch to Decode and paste it back: you should get the original text.
What each mode encodes
URLs may only contain a limited set of ASCII characters (RFC 3986). Anything else is written as % followed by the hex value of each UTF-8 byte, which is why this is called percent-encoding.
- Encode each query value separately, then join them with
&and= - The browser address bar shows decoded text but sends the encoded form
- Hex digits are case-insensitive:
%2fand%2Fdecode the same
| Character | Parameter value (encodeURIComponent) | Full URL (encodeURI) |
|---|---|---|
Letters, digits, - _ . ! ~ * ' ( ) | Kept | Kept |
| Space | %20 | %20 |
& = ? / | %26 %3D %3F %2F | Kept |
: # + @ | %3A %23 %2B %40 | Kept |
% | %25 | %25 |
é | %C3%A9 | %C3%A9 |
中 | %E4%B8%AD | %E4%B8%AD |
One campaign name, four outcomes
The campaign "Spring Sale & 50% off" goes into utm_campaign. Only the first row produces a link that reports the right campaign.
| Input | Mode | Result | What happens |
|---|---|---|---|
Spring Sale & 50% off | Parameter value | Spring%20Sale%20%26%2050%25%20off | Correct: the whole name arrives as one value |
Spring Sale & 50% off | Full URL | Spring%20Sale%20&%2050%25%20off | The & is kept, so the campaign is cut to "Spring Sale " |
https://example.com/a%20b | Full URL | https://example.com/a%2520b | Double-encoded: %20 became %2520 |
50% off | Decode | Error | % o is not a valid escape, so the tool reports it |
Row two is easy to miss: the link still opens, but analytics sees a campaign called "Spring Sale " and a stray parameter named " 50% off". Lowercase, underscore-separated campaign names such as spring_sale_50_off avoid encoding questions altogether.
Where URL encoding goes wrong
Each of these produces a link that opens but carries the wrong data.
Value encoded as a full URL
encodeURI leaves &, = and # alone, so a value containing them splits the query string or cuts it short.
Whole link as a value
Parameter-value mode turns https:// into https%3A%2F%2F. That is right inside a redirect parameter and broken as a link of its own.
Encoding twice
Encoding an already encoded string turns each % into %25. If you see %25 followed by two hex digits, decode once more.
Mixing up + and %20
Forms encode spaces as +; most other code uses %20. A literal plus sign must be sent as %2B, or a server reading form encoding turns it into a space.
Campaign links that report cleanly
Encoding gets a campaign name into the link intact. TapCub picks it up on the landing page: it reads UTM parameters and ad click IDs from the URL and keeps the source on the visitor.
Campaign reports
UTM values are normalised on arrival (case, spacing, known aliases), then broken down by campaign, source, medium, term and content.
Learn moreAd click IDs
Click IDs from 14 ad platforms are read from the landing URL on the first page view, even without UTM tags.
Learn morePage reports
Entry and exit pages, 404s with the referrer that sent people there, site search and outbound clicks.
Learn moreURL encoding questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
What is URL encoding?
Also called percent-encoding: characters that are not allowed in a URL, or that have a special meaning there, are replaced by % and two hex digits per byte. A space becomes %20, & becomes %26, and non-ASCII text is first turned into UTF-8 bytes.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes everything with a special meaning in a URL, so it is for a single value. encodeURI keeps : / ? & = # so a whole URL stays usable, which makes it wrong for values. When in doubt, encode each value with encodeURIComponent and build the URL around it.
Should a space be %20 or +?
Both are common. %20 works anywhere in a URL. + means a space only in query strings encoded the way HTML forms do it (application/x-www-form-urlencoded). This tool encodes spaces as %20 and can decode either.
Why does decoding fail with an error?
Either a % is not followed by two hex digits, as in "50% off", or the bytes do not form valid UTF-8, for example a character cut in half or text from an old page using a legacy encoding. Encode literal percent signs as %25.
Why do accented letters and emoji turn into long strings?
Encoding works on UTF-8 bytes, not characters. é is two bytes (%C3%A9), a Chinese character is three and most emoji are four, and each byte becomes three characters in the URL.
Do I need to encode UTM parameters?
Yes, if a value contains spaces, &, # or non-ASCII text. The UTM link builder encodes each value for you, and its normalise option turns names into lowercase with underscores so they need no encoding at all.
Is what I paste sent anywhere?
No. Encoding and decoding run in your browser and nothing is sent to TapCub. The share link stores the text after # in the address, a part browsers do not send to the server, but anyone with the link can read it, so do not share links containing tokens or signed URLs.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
Follow the link to the conversion
Connect your site and every tagged link shows visits, conversions and revenue by campaign, source and medium.