Skip to content

URL Safe Base64 Encoder / Decoder

Encode and decode Base64 using the URL-safe alphabet (RFC 4648 §5) — replaces + with - and / with _ so output is safe in URLs, filenames, and JWTs without percent-encoding.

Updated

What is the URL Safe Base64 Encoder / Decoder?

How it works

Examples

Encode plain text

Hello, World!
SGVsbG8sIFdvcmxkIQ

Encode a URL string

https://example.com/a/b?q=x+y
aHR0cHM6Ly9leGFtcGxlLmNvbS9hL2I_cT14K3k

Encode a JSON payload (JWT-style)

{"id":1,"role":"admin"}
eyJpZCI6MSwicm9sZSI6ImFkbWluIn0

Decode a Base64url token

eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0
{"sub":"1234567890","name":"John Doe"}

Standard vs URL-safe comparison

https://example.com/~/b?q=x+y
aHR0cHM6Ly9leGFtcGxlLmNvbS9-L2I_cT14K3k

Frequently asked questions