Base64 Encoder / Decoder
Encode any text or binary data to Base64 and decode Base64 strings back to plain text — instantly, in your browser, with zero uploads.
0 chars
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using only 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It was originally designed to safely transmit binary data — like images or certificates — through channels that only handle text, such as email (MIME) or JSON API payloads.
You encounter Base64 constantly as a developer: embedding images as data: URIs, storing credentials in HTTP Basic Auth headers, JWT tokens, encoding binary blobs in environment variables, and passing arbitrary bytes through systems that only accept printable text.
Decoding is simply the reverse — taking a Base64-encoded string and recovering the original bytes. This tool handles both directions and properly round-trips Unicode text using encodeURIComponent before encoding, so characters like emoji and Chinese text survive the conversion.
How to use the Base64 tool
- 1
Choose a mode
Click Encode to convert plain text → Base64, or Decode to convert Base64 → plain text.
- 2
Paste your input
Type or paste the text into the left pane. Output appears instantly on the right.
- 3
Copy the result
Use the Copy button to copy the output, or Swap to send the output back as the new input.
Why developers need Base64
JSON-safe binary payloads
JSON only handles text. Base64 lets you embed images, PDFs and binary blobs directly in a JSON field.
HTTP headers
Basic Auth encodes credentials as Base64: <code>Authorization: Basic dXNlcjpwYXNz</code>.
Data URIs
Inline images and fonts in HTML/CSS using <code>data:image/png;base64,…</code> to eliminate extra HTTP requests.
Environment variables
Store TLS certificates, private keys, or binary files as Base64 strings in <code>.env</code> files and CI secrets.
Examples
Hello, World!SGVsbG8sIFdvcmxkIQ==The trailing == padding brings the output to a multiple of 4 characters.
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9{"alg":"HS256","typ":"JWT"}JWT uses Base64url (- instead of +, _ instead of /). Switch to Decode mode to read any JWT segment.
Frequently asked questions
No. Base64 is encoding, not encryption. It is trivially reversible by anyone who sees the string. Never use Base64 to protect sensitive data — use a proper encryption algorithm (AES-GCM, etc.) for that.
Base64 produces output in chunks of 4 characters. If the original byte count isn't divisible by 3, padding characters (=) are added to complete the last group.
Base64url replaces + with - and / with _ to make the string safe in URLs and filenames without percent-encoding. JWTs use Base64url. Standard Base64 uses + and / which need escaping in URLs.
This tool encodes text strings. To encode binary files (images, PDFs), you'd typically do that programmatically in your language of choice — the underlying algorithm is the same.
No. All encoding and decoding happens entirely inside your browser using the built-in btoa() and atob() functions. No data is transmitted anywhere.
Need another tool?
Browse the full toolbox or dig into the blog for the engineering behind it.