InfraHub

About the Base64 Encoder / Decoder

01.What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is used to transmit binary data over text-based protocols like email (MIME), HTTP headers, and JSON. The URL-safe variant (RFC 4648 §5) replaces "+" with "-" and "/" with "_" to make the encoded string safe for use in URLs and filenames without percent-encoding.

InfraHub's Base64 tool supports both standard and URL-safe variants with full UTF-8 character support. All processing is local — nothing is sent to any server.

02.How It Works

For encoding, the tool converts the input string to a UTF-8 byte array using TextEncoder, then applies the standard Base64 algorithm which groups every 3 bytes into 4 six-bit values, each mapped to a Base64 character. For URL-safe encoding, "+" and "/" are substituted. Decoding reverses this process using TextDecoder to reconstruct the original UTF-8 string. Padding ("=") is handled automatically.

03.Common Use Cases

Developers encode binary data (like images) for embedding in JSON APIs or data URIs. Security engineers decode Base64-encoded payloads in JWTs, SAML assertions, or suspicious email attachments during incident investigation. Web developers encode Basic Auth credentials (username:password) for HTTP Authorization headers. DevOps engineers decode Kubernetes secrets and CI/CD environment variables stored in Base64.

Share Feedback

We read every message