Base64 Guides & Tutorials
32 practical guides on Base64 — from core concepts to every major language and platform.
CLINew
base64 Command (Linux & macOS)
Flags, GNU vs BSD differences, -w 0 line wrapping, and shell pipeline patterns.
TroubleshootingNew
Fix Invalid Base64 Errors
Diagnose and fix padding errors, whitespace issues, and wrong variant errors across all languages.
Use CaseNew
HTTP Basic Auth & Base64
How Basic Authentication encodes credentials in the Authorization header, with security warnings.
ConceptsNew
Base64 vs Base32, Base58 & Base85
Compare all binary-to-text encoding schemes: size overhead, alphabet, and when to use each.
CLINew
OpenSSL Base64
openssl enc -base64, the critical -A no-linebreak flag, and certificate workflows.
DevOpsNew
SSH Keys & PEM Certificates
Encode private keys for env vars, Docker, Kubernetes, and CI/CD pipelines.
Use CaseNew
Base64 File Upload in React
Convert files and images to Base64 with FileReader in React, with TypeScript types.
CNew
Base64 in C
Lookup-table encoder/decoder implementation, URL-safe variant, and OpenSSL EVP API.
BashNew
Base64 in Bash Scripts
The echo -n newline gotcha, file encoding, env variables, and multi-line handling.
ConceptsNew
Base64 Padding Explained
Why = signs exist, how padding is calculated from input length, and when it can be omitted.
PowerShellNew
Base64 in PowerShell
[Convert]::ToBase64String, the UTF-16 encoding trap, and cross-platform usage.
DartNew
Base64 in Dart & Flutter
dart:convert base64 and base64Url codecs, image encoding, and HTTP usage.
Use CaseNew
Binary Data in JSON
How and when to embed binary in JSON with Base64 — tradeoffs and multipart alternatives.
C++New
Base64 in C++
std::string implementation, Boost.Beast base64, and OpenSSL EVP API.
Concepts
What is Base64 Encoding?
A complete explanation of the Base64 scheme, the 64-character alphabet, padding, and when to use it.
Concepts
URL-Safe Base64 (RFC 4648)
How URL-safe Base64 differs from standard Base64, and when to use it in JWTs, URLs, and filenames.
Use Case
Image to Base64 Data URI
Embed images directly in HTML and CSS using Base64 data URIs. When to use them and when to avoid.
Use Case
Base64 in JSON Web Tokens (JWT)
How JWTs use Base64URL encoding for headers, payloads, and signatures.
Concepts
Base64 vs Hex Encoding
When to choose Base64 over hexadecimal encoding, and vice versa. Size comparison and use cases.
Use Case
Base64 Data URIs Explained
The data: URI scheme in depth — syntax, MIME types, browser support, and performance.
JavaScript
Base64 in JavaScript
btoa(), atob(), TextEncoder, Buffer in Node.js, and handling Unicode strings correctly.
TypeScript
Base64 in TypeScript
Type-safe Base64 encoding and decoding in TypeScript for browser and Node.js environments.
Node.js
Base64 in Node.js
Using Node.js Buffer to encode and decode Base64 strings, files, and streams.
Python
Base64 in Python
The base64 module, b64encode/b64decode, URL-safe variants, and encoding binary files.
Java
Base64 in Java
java.util.Base64 — basic, URL-safe, and MIME encoders in Java 8+.
Go
Base64 in Go
encoding/base64 package — StdEncoding, URLEncoding, RawURLEncoding, and byte slices.
Rust
Base64 in Rust
Using the base64 crate Engine API with standard and URL-safe alphabets.
PHP
Base64 in PHP
base64_encode(), base64_decode(), URL-safe Base64, and encoding binary file data.
C#
Base64 in C# (.NET)
Convert.ToBase64String, FromBase64String, byte arrays, streams, and URL-safe Base64.
Ruby
Base64 in Ruby
encode64 vs strict_encode64 vs urlsafe_encode64 and the critical differences.
Swift
Base64 in Swift
Data.base64EncodedString() and Data(base64Encoded:) for iOS and macOS apps.
Kotlin
Base64 in Kotlin
java.util.Base64 in Kotlin, multiplatform approaches, and Ktor utilities.
No articles in this category yet.
Need to encode or decode Base64 right now?
Use our free, instant Base64 tool — no ads, no tracking, keyboard shortcuts included.
Open base64.dev →