URL Encoder & Decoder

Percent-encode or decode URL components using standard encodeURIComponent semantics — the same rules JavaScript itself uses.

Output

How to use the URL tool

URLs can only safely contain a limited set of characters. Anything else — spaces, accented letters, non-ASCII text, or reserved symbols such as & and ? — must be percent-encoded before it can appear in a query string or path segment.

To encode, paste your text and press Encode. The tool applies encodeURIComponent, which encodes every character except the unreserved set (A–Z a–z 0–9 - _ . ! ~ * ' ( )). For example, a b becomes a%20b, and hello&world becomes hello%26world. This is the correct behavior when building query parameters, as opposed to encodeURI, which leaves reserved characters like ? and # intact.

To decode, paste a percent-encoded string and press Decode. The tool reverses the encoding using decodeURIComponent. If the input contains a malformed sequence — such as a bare % not followed by two hex digits, or an invalid UTF-8 byte sequence — it reports a clear error instead of throwing. This matters when you copy a URL that has been truncated or double-encoded by a forwarding service.

Common uses

  • Building query strings for API requests (?q=hello%20world).
  • Encoding user input before inserting it into a URL or redirect target.
  • Debugging why a URL returns 400 when a space or ampersand is left unencoded.

More developer tools