Skip to content
ufraan
← Back

b64

Fast terminal base64 encoder/decoder with base32, base16, streaming and URL-safe support.

GoCLI
Jun 2026GitHub

b64 is a base64 encoder and decoder for the terminal, written in Go. It handles standard base64, the URL-safe alphabet, base32 and hex, and it streams - data is read in small chunks, three bytes in and four characters out, so a file of any size goes through without being loaded into memory.

Custom Malware shellcode injection diagram
Custom Malware shellcode injection diagram

You can run it with an explicit encode or decode subcommand, or with neither and let it work it out. Auto-detect peeks at the first 512 bytes: binary data gets encoded, valid-looking base64 gets decoded, and anything ambiguous errs toward encoding. Flags cover line wrapping, the URL-safe alphabet, padding, base32 and hex output, skipping garbage inside an otherwise valid file, and a check mode that validates input without decoding it.

The reason it exists is speed. On an Apple M5 with 64KB blocks it runs around 1.9 GB/s for encoding and 800 MB/s for decoding, roughly an order of magnitude faster than the system base64. The test suite does roundtrips for every variant and cross-validates against the system tool, so the output is byte-identical rather than merely plausible.