Base64 Encode & Decode

Encode text to Base64 or decode a Base64 string back to plain text. Supports standard and URL-safe alphabets. Everything runs in your browser — nothing is sent to a server.

Alphabet

Edit to encode → Base64

Edit to decode → plain text

Ready
Try an example

Base64 reference

What is Base64?

Base64 encodes binary data as a sequence of printable ASCII characters. Every 3 bytes of input become 4 characters in the output, using the alphabet A–Z a–z 0–9 + / with = padding to fill incomplete groups.

The encoded output is approximately 33% larger than the original.

Standard vs URL-safe

Standard
Uses + and /; padded with =. Used in email (MIME), PEM certificates, and most general contexts.
URL-safe
Replaces +- and /_; padding omitted. Used in JWTs, OAuth tokens, and URL parameters.

Common uses

HTTP Basic Auth
Authorization: Basic <base64(user:pass)>
JWTs
Header and payload are Base64url-encoded JSON objects
Data URIs
data:image/png;base64,<data> embeds images in HTML/CSS
Kubernetes secrets
Secret values are stored Base64-encoded in manifests
Email attachments
MIME encodes binary attachments as Base64 for safe transit
TLS certificates
PEM files wrap DER-encoded certs in Base64 between headers

CLI equivalents

Encode (Linux/macOS)
echo -n "text" | base64
Decode (Linux/macOS)
echo "dGV4dA==" | base64 -d
Encode (PowerShell)
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("text"))
Kubernetes secret
kubectl create secret generic mysecret --from-literal=key=value