Codec lesson · Base64URL
Base64URL: Base64 for filenames and URLs
Base64URL is the RFC 4648 URL- and filename-safe alphabet. It replaces + and / with - and _, while Encode Keyboard emits the optional padding-free form.
Completed in this browser
Distinguish Base64URL from standard Base64 and validate a canonical UTF-8 text value without confusing encoding with encryption.
Encode Keyboard converts UTF-8 bytes with the RFC 4648 Base64URL alphabet and removes trailing = padding. Decode accepts canonical unpadded text or exactly the required padding, then requires valid UTF-8.
How Encode Keyboard handles it
Start with UTF-8 bytes
Text first becomes the same byte sequence used by the other exact data formats.
Use the URL-safe alphabet
The indices that standard Base64 writes as + and / are written as - and _.
Validate before returning text
Decode checks the alphabet, impossible lengths, allowed padding, canonical re-encoding, and UTF-8 output.
Worked example
Hello?SGVsbG8_The final _ is the URL-safe symbol where standard Base64 would use /. Encode Keyboard omits = padding.
Good uses
- Reading URL-safe tokens that are documented as Base64URL
- Learning the difference between Base64 alphabets
- Moving non-sensitive UTF-8 text through filename-safe fields
Validation and common errors
- Use only A–Z, a–z, 0–9, - and _ before optional trailing =
- Do not mix + or / from standard Base64
- Padding, when present, must be exactly the amount required by the final block
Practice in your browser
This uses the same documented rules as the app and runs only in this tab.