URL Encoder & Decoder
Percent-encode text for URLs, or decode percent-encoded URLs back to plain text
URL (percent) encoding replaces characters that aren't safe in a URL — spaces, ampersands, question marks — with a % followed by their hex code, so query strings and paths transmit correctly. This tool encodes and decodes entirely client-side.
Frequently Asked Questions
When do I need to URL-encode text?
Whenever a value you're placing into a URL — a query parameter, form field, or path segment — might contain reserved characters like spaces, &, ?, #, or non-ASCII characters. Encoding prevents those characters from being misread as part of the URL's structure.
What's the difference between encodeURIComponent and encodeURI?
This tool uses component-style encoding (like JavaScript's encodeURIComponent), which escapes all reserved characters including &, =, and ?. That makes it correct for encoding individual query parameter values, as opposed to whole URLs where those characters are structurally meaningful.
Why does decoding fail with an error?
Decoding fails if the input contains a malformed percent sequence, such as a lone % not followed by two valid hex digits. Double-check that you're pasting a fully percent-encoded string.
Are spaces encoded as %20 or +?
This tool encodes spaces as %20, which is correct for URL paths and most modern usage. The + convention for spaces is specific to application/x-www-form-urlencoded form submissions, not general URL encoding.
Have suggestions or feedback? We're constantly improving FormatChamp based on your comments.