Encode text to URL-safe Base64 format

Encode bytes as unpadded URL-safe Base64.

freeworks offlinenothing uploaded
ToolBase64URL Encode
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Bytes become 24-bit groups mapped through - and _ in place of + and /; trailing padding is omitted. The remaining length allows a decoder to restore the missing padding.

  • URL-safe output avoids percent-encoding.
  • Padding omission suits cookies and tokens.

Worked example

Encode for URL
Encode text to URL-safe Base64 (no padding, safe characters)
Input
											Hello, World!
										
Output
												SGVsbG8sIFdvcmxkIQ
											

When to use this

JWTs, signed URLs, and WebAuthn challenges encode binary values.

Edge cases

  • Removing non-trailing padding loses length information.
  • Unicode must be converted to UTF-8 bytes first.
  • Base64url is reversible encoding, not encryption.

References