Encode and decode URLs online
Query strings and URL parameters need special characters percent-encoded to be valid. Switch between encode and decode mode, paste your text or URL, and get the result instantly using JavaScript's built-in encodeURIComponent/decodeURIComponent. Everything runs in your browser; nothing you paste is sent anywhere.
Why URLs need encoding
URLs have a limited safe character set, and several characters carry structural meaning — ? starts a query string, & separates parameters, # starts a fragment. Putting those inside a parameter value without encoding breaks the URL's structure, so a search for 'cats & dogs' would be read as two parameters rather than one value. Percent-encoding replaces each unsafe byte with a % followed by its hex code, making the value safe to carry.
Encoding a component, not a whole URL
This tool uses component encoding, which escapes the structural characters including slashes, ampersands, and question marks. That is correct for encoding a single parameter value, and wrong for encoding a complete URL — running an entire address through it turns https://example.com into https%3A%2F%2Fexample.com, which is exactly what you want when passing a URL as a redirect parameter, and useless if you wanted a working link.
Common decoding failures
Decoding fails when input contains a stray percent sign not followed by two hex digits, which usually means the text was double-encoded, truncated in transit, or was never encoded in the first place. A percent that is meant literally must itself be encoded as %25. If a URL from a log or an email fails to decode, check whether it was wrapped or shortened by the system that carried it.
Frequently asked questions
- What characters get encoded?
- Reserved and special characters like spaces, &, =, and ? are percent-encoded (e.g. a space becomes %20).
- What happens with malformed encoded text in decode mode?
- You'll see a clear error rather than a crash if the input has an invalid percent-encoding sequence.
- Is my text sent anywhere?
- No, encoding and decoding happen locally in your browser. Nothing is transmitted.
- Why did my whole URL get mangled?
- This encodes parameter values, so slashes and colons are escaped too. Encode only the value you are inserting, not the complete address.
- What is the difference between + and %20 for a space?
- Both appear in the wild. %20 is correct in URL paths; + is a legacy convention from form encoding in query strings. This tool produces %20.