Base64url
Base64url is the RFC 4648 binary-to-text variant that uses minus and underscore instead of Base64's plus and slash symbols.
Alphabet: The changed symbols represent the same six-bit values; the input remains bytes, not Unicode characters. Padding is a separate protocol choice. Base64url does not universally mean that equals signs are forbidden. [1]
Profiles: JSON Web Signature specifies base64url without trailing equals signs, line breaks or whitespace. The signed representation is protocol-defined; do not normalize its text independently of signature verification rules. [2]
Decoder labels: Node's base64 and base64url Buffer decoders both accept the other alphabet; its base64url encoder omits padding. Successful decoding therefore does not establish that an input used only URL-alphabet symbols. [3]
Example: Bytes 0xfb 0xff encode as +/8= in padded Base64 and -_8 in an unpadded URL profile. An exact-profile check also tests unused bits: -w encodes 0xfb canonically, while -x has nonzero unused bits. [4]
Relations
- related
- Base64, Data serialization
Citations
- RFC 4648: Base-N encodings, sections 3-5 and 10
- RFC 7515: JWS terminology, base64url encoding and signing input
- Node v24.22.2: Buffer binary-to-text encodings
- Hesela: Base64 checksum representations and native decoder observations
Sources & caveats
- The example selects an unpadded URL profile. It is not a claim that every RFC 4648 application forbids padding.
- Native decoder acceptance is version-qualified and does not certify service-side acceptance or authentication.