URL Encoder / Decoder
Encode or decode URLs and query parameters, instantly.
What URL encoding actually does
A URL is allowed to contain only a limited set of characters. Everything else — spaces, ampersands, question marks, accented letters, emoji — has to be rewritten before it can travel safely inside an address. That rewriting is called percent-encoding: each unsafe character becomes a percent sign followed by its hexadecimal value, so a space turns into %20 and an ampersand into %26.
The consequences of skipping it are quietly destructive. An unencoded ampersand inside a parameter value does not stay part of that value; the browser reads it as the start of a new parameter, and everything after it is silently reassigned. A search term like salt & pepper arrives at your server as salt plus a stray parameter named pepper. The link does not error. It just returns the wrong thing.
Component or full URL?
The distinction matters more than it looks. encodeURIComponent escapes the structural characters of a URL too — the slashes, the colon, the question mark — which is exactly right when you are encoding one value that will be dropped into a parameter. encodeURI leaves that structure intact, which is what you want when the thing you are encoding is a complete address. Reach for the wrong one and you either mangle a working URL or leave a value able to break out of its parameter.
Decoding is the reverse trip, and it is how you read a redirect chain, an email tracking link or a callback URL that someone has stuffed inside another URL. If decoding fails here, that is usually a genuine signal: a lone % that is not followed by two hex digits is not valid encoding, and this tool will tell you rather than guess.
Where this fits in a link workflow
Encoded URLs are correct but rarely presentable — a tagged campaign link with an encoded redirect inside it can run to several hundred characters. That is why encoding and shortening usually happen together: encode so the value survives the journey, then shorten so a human is willing to click it. The tracking data travels intact either way.
Frequently asked questions
What is URL encoding?
URL encoding, also called percent-encoding, replaces characters that are unsafe in a URL with a percent sign followed by two hexadecimal digits. A space becomes %20 and an ampersand becomes %26, so the value travels intact instead of breaking the address.
When do I need to encode a URL?
Whenever a value goes inside a query parameter and could contain a space, an ampersand, a question mark, a slash or a non-English character. Search terms, email addresses, redirect URLs and pre-filled messages are the usual cases.
What is the difference between encodeURI and encodeURIComponent?
encodeURI leaves the structural characters of a URL alone, so it is meant for encoding a whole address. encodeURIComponent escapes those characters too, which is what you want for a single parameter value. This tool offers both.
Why does my link break when it contains an ampersand?
An unencoded ampersand starts a new query parameter, so everything after it is read as a separate value. Encoding it as %26 keeps it part of the value it belongs to.
Is my data sent anywhere?
No. The encoding and decoding both run in your browser, so nothing you paste ever leaves your device.