Example: the tool is already working on a sample input. Replace it with your own and press the button.

https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dbase64%20%26%20jwt%26lang%3Dde-AT

Characters: 74

URL encode and decode

Paste text or an encoded URL, choose encode or decode and the mode. URL component escapes every character outside A–Z a–z 0–9 - . _ ~ as %XX, so a space becomes %20. Form data follows HTML forms and writes a space as +. Text is encoded as UTF-8.

What URL encoding does

A URL may only contain a limited set of ASCII characters, and some of them – ? & = / # + – give the URL its structure. Percent-encoding (RFC 3986) writes every other byte as a percent sign followed by two hexadecimal digits, so that a value can be put into a URL without changing its meaning. Characters outside ASCII are first converted to their UTF-8 bytes: ü becomes %C3%BC.

Examples

  • a b&c becomes a%20b%26c as a URL component and a+b%26c as form data.
  • München becomes M%C3%BCnchen.
  • q=base64%20decode decodes to q=base64 decode.

URL component or form data?

Use URL component for a path segment or a single query value. It escapes the same characters as JavaScript's encodeURIComponent, plus ! ' ( ) *. Use form data for application/x-www-form-urlencoded request bodies and for query strings built by HTML forms, where + means a space. When decoding, that is the only difference: in form mode a + turns into a space, as a URL component it stays a plus sign.

Encode a whole URL?

Encode the parts, not the whole URL. Encoding https://example.com/?q=1 as one component also escapes the :, the / and the ?. That is right for a URL passed as a parameter of another URL, such as a redirect target, but not for a link that should still open.

URL encoding is not base64: to put binary data into a URL, use the URL-safe variant of the base64 encoder. Tokens in URLs are often JSON Web Tokens, which the JWT decoder reads.

Base64, URL and JWT tools

Frequently asked questions

What does URL encoding do?
It replaces every character that is not allowed or has a special meaning in a URL with a percent sign and two hexadecimal digits, so that a value can be put into a URL safely.
Should a space become %20 or +?
In a path or a single URL component a space is %20. Only in form data (application/x-www-form-urlencoded) is a space written as +.
Why does decoding fail with an error?
A percent sign has to be followed by two hexadecimal digits. A lone % or one followed by other characters is not a valid escape; the error names its position.