Home

base64urlencoded

Base64url encoded, or base64url, refers to a variant of Base64 encoding designed for use in URLs and filenames. It uses the same 64-character set as Base64 but replaces the two characters that are problematic in URLs and filenames: '+' becomes '-' and '/' becomes '_'. In many contexts padding '=' characters are also omitted. The format is described in RFC 4648 as base64url.

Compared with standard Base64, base64url changes the alphabet and often removes padding. Decoding base64url requires a

Base64url is widely used in web-related technologies where data must be placed in URLs or query strings

Example: the ASCII string Hello encodes in standard Base64 as SGVsbG8=; in base64url form it is typically

decoder
that
understands
the
URL-safe
character
set
and,
if
padding
is
omitted,
uses
the
input
length
to
determine
the
proper
block
size.
Some
implementations
accept
both
padded
and
unpadded
input.
without
escaping.
It
is
commonly
used
in
JSON
Web
Tokens,
OAuth
2.0,
OpenID
Connect,
and
certain
API
signatures.
It
preserves
the
data
while
ensuring
URL
safety
and
filename
safety.
written
as
SGVsbG8
(no
padding).
Some
systems
keep
the
padding,
yielding
SGVsbG8=.
The
choice
depends
on
the
specific
protocol
or
library.