URL Encoder/Decoder
Pure client-side URL encoding and decoding. Nothing leaves your browser.
URL encoding (percent-encoding) converts special characters into %XX sequences so a string can be safely embedded in a URL. "Component" mode uses encodeURIComponent, which escapes all URL structure characters like / : ? # & = — use it when encoding the value of a single query parameter (e.g. the text that goes after ?q=). "Full URL" mode uses encodeURI, which leaves those structure characters untouched and only escapes things like spaces — use it when encoding an entire URL.
FAQ
What's the difference between Component and Full URL mode?
Component mode (encodeURIComponent) escapes / : ? # & = because it assumes you're encoding a piece of a URL, such as a single parameter value — those characters would otherwise break the URL's structure. Full URL mode (encodeURI) assumes you're encoding an entire URL, so it leaves structure characters alone and only escapes things like spaces or non-ASCII characters.
When should I use Component mode?
Use it whenever you're placing arbitrary text into a single query parameter, e.g. ?redirect=<here>. Otherwise, an & or = inside your text would be misread as a new parameter.
Why does decoding fail sometimes?
If the string contains a stray % that isn't followed by two valid hex digits, decoding throws an error because it isn't a valid percent-encoded sequence.