URL Encoder
Percent-encode text for use in a URL. Choose whether you are encoding a whole URL or a single parameter value.
How to use the URL Encoder
- 1Paste the URL or the value you want to encode.
- 2Choose the mode: full URL, or a single component.
- 3Copy the encoded result.
- 4Switch to component mode if you are building a query string.
How it works
There are two different jobs here and using the wrong one is the classic URL bug. Encoding a full URL must leave the structural characters alone — the :// , the / between path segments, the ? and the & — or the URL stops being a URL. Encoding a single parameter value must escape those same characters, or a value containing & will be read as the start of another parameter.
So encoding https://example.com/a b as a full URL gives https://example.com/a%20b, with the slashes intact. Encoding the same string as a component escapes everything: https%3A%2F%2Fexample.com%2Fa%20b — which is exactly right when that URL is being passed as a redirect parameter.
Percent-encoding writes each disallowed byte as % followed by two hex digits. Non-ASCII characters are converted to UTF-8 first, so a single character can become several escapes: é becomes %C3%A9.
Spaces have two encodings. In a path a space is %20; in a query string, + is also accepted by most servers as a legacy convention. %20 is always safe.
Everything runs in this page. Nothing you paste is transmitted, logged or stored, which is what makes it safe to drop a production payload in here while you are debugging.