Base64URL encoder and decoder
Base64URL is the URL- and filename-safe variant of Base64 defined in
RFC 4648 §5. It swaps the two problematic characters — + becomes - and
/ becomes _ — and drops the trailing = padding, so the encoded string can
travel inside a URL query string, a filename or a JWT without any extra
percent-escaping.
How it works
To encode, the tool converts your text to UTF-8 bytes, runs them through the
browser’s btoa, then applies three substitutions: + → -, / → _, and it
strips trailing =. To decode it reverses those swaps and re-adds the right
amount of = padding (so the length becomes a multiple of 4) before calling
atob and decoding the bytes as UTF-8.
Example
Encoding Hello, Gera Tools!:
standard Base64:
SGVsbG8sIEdlcmEgVG9vbHMhBase64URL:SGVsbG8sIEdlcmEgVG9vbHMh(no + / = here, so identical)
A value containing bytes that map to + or / shows the difference, e.g.:
| Standard Base64 | Base64URL |
|---|---|
Pz4/Pg== | Pz4_Pg |
+/A= | -_A |
Everything runs locally in your browser — your data is never uploaded.