encode | decode | compress

> base64url | jwt | url-safe <

// Base64url - URL and filename safe Base64 variant without padding

[URL-SAFE]

URL Compatible

No special URL characters - safe for query parameters and paths.

[JWT]

JWT Standard

Used in JSON Web Tokens and OAuth 2.0 specifications.

[NO-PADDING]

Optional Padding

Padding characters (=) can be omitted for cleaner URLs.

>> technical info

How Base64url Works:

Base64url is a variant of Base64 that replaces '+' with '-' and '/' with '_', making it safe for URLs and filenames. The padding character '=' is often omitted since it can cause issues in URLs.

Comparison:

Base64: SGVsbG8+Pw== Base64url: SGVsbG8-Pw

Why Use Base64url:

  • >JWT tokens
  • >OAuth 2.0 flows
  • >URL query parameters
  • >Filename encoding
  • >Web API signatures

>> frequently asked questions

What is Base64url?

Base64url is a URL and filename-safe variant of Base64 encoding. It replaces '+' with '-', '/' with '_', and optionally removes padding '=' characters to avoid URL encoding issues.

Why not use regular Base64 in URLs?

Regular Base64 uses '+', '/', and '=' characters which have special meanings in URLs. The '+' becomes a space, '/' is a path separator, and '=' is used for parameters, causing parsing issues.

Where is Base64url used?

Base64url is widely used in JWTs (JSON Web Tokens), OAuth 2.0 authorization codes, SAML assertions, and any API that needs to pass binary data in URLs or HTTP headers.

Is padding required in Base64url?

No, padding is optional in Base64url. Many implementations omit padding since the length can be calculated. JWTs specifically require no padding for a cleaner URL appearance.

Other Languages