Free Base64 Encoder & Decoder Online
The best free base64 encoder and decoder online. Encode text to base64 or decode base64 strings back to plain text instantly.
Built With Care
“Uses the browser's built-in atob() and btoa() functions for standards-compliant encoding and decoding. Supports Unicode and handles multi-line strings.”
Base64 Converter & Developer Inspector
Encode plain text to Base64 or decode Base64 back to readable text. Uses the browser's native atob/btoa functions so nothing gets sent anywhere. Handles Unicode and emojis correctly.
- 1Toggle the mode to either 'Encode' (Text to Base64) or 'Decode' (Base64 to Text).
- 2Paste your source material into the input field. The tool handles multi-line strings effortlessly.
- 3Click the action button to perform the transformation instantly.
- 4Inspect the output for accuracy and use the copy button to transfer it to your clipboard.
- 5Use the 'Swap' button to quickly reverse the transformation or verify your results.
- Bidirectional Processing: Encode or decode in either direction from one screen.
- Developer-First Precision: Perfect for handling JWT parts, Basic Auth headers, and data URIs.
- Standard RFC 4648 Compliance: Compatible with all modern programming languages and web APIs.
- Client-side processing: No data is sent to external servers.
- Large Payload Support: Handles massive strings and complex JSON blobs without performance degradation.
Base64 Converter & Developer Inspector Specs
Limits
- Text and file base64 encode/decode
- Handles unicode via UTF-8
Formats
- Output: base64 string or decoded text/file
Defaults
- UTF-8 for text
- Data URI option for files
How it works
- btoa/atob with UTF-8 polyfill
Honest caveats
- Not encryption
- Large files may exceed memory limits
Real Ways People Use This
API Development & Debugging
Quickly decode Basic Auth headers or inspect JWT payloads during backend troubleshooting and integration testing.
Data URI Generation
Encode small assets or SVG strings to create data URIs for CSS or HTML embedded images.
Email Header Inspection
Decode email subjects or body parts that are encoded in Base64 for transport across legacy systems.
Configuration Mangement
Safely encode config files or environment variables that need to be passed as single-line strings in CI/CD pipelines.
Cross-Language Data Passing
Standardize complex data formats into safely transportable ASCII strings for inter-service communication.
Related Guides & Tutorials
Passkeys and WebAuthn Level 3: How Passwordless Sign-In Actually Works
WebAuthn Level 3 became a W3C Recommendation in August 2026, five years after Level 2, and passkeys now sit behind billions of active credentials. This guide walks through the cryptography that makes a passkey unphishable, the new Level 3 features, and a staged rollout plan for an app that still has password users.
Read the guideBase64 Encoding Explained: What It Is, When You Need It, and When It'll Bite You
Stop copy-pasting into random websites. Here's what Base64 encoding actually does, where it's used in real systems, and a free tool to encode and decode instantly.
Read the guideTop 10 Free Online Developer Tools You Should Bookmark in 2026
Forget installing yet another VS Code extension. These 10 browser-based developer tools handle JSON formatting, regex testing, JWT debugging, and more — no signup, no uploads.
Read the guide- Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string. Never use it to protect sensitive data without actual encryption.
- For binary data like images or files, use the dedicated Base64 Image Decoder tool for better results.
- 1Verify your input is valid UTF-8 text before encoding to avoid garbled output.
- 2Check for trailing '=' padding when decoding — it's normal and part of the RFC 4648 standard.
Questions That Usually Come Up
More Tools You’ll Actually Use
Base64 is an alphabet,not a secret.
Three input bytes become four characters. Each byte dissolves into eight bits, every 24-bit window regroups into four 6-bit values, and each 6-bit value (0–63) maps to one printable ASCII slot. That is the entire algorithm — no key, no checksum, no compression. Base64 exists to move binary through text-only plumbing: emails, headers, URLs, JSON payloads.
Work the example once and every string you have ever seen decodes on sight. The encoder is not magic — it is a lookup table with a fixed rhythm.
The 64 slots, in order
| Values | Characters | Worth knowing |
|---|---|---|
| 0 – 25 | A – Z | Uppercase first. |
| 26 – 51 | a – z | Lowercase next. |
| 52 – 61 | 0 – 9 | Digits come after letters — the order everyone forgets. |
| 62 | + | Becomes - in Base64URL. |
| 63 | / | Becomes _ in Base64URL. |
| padding | = | Fills the final group to a multiple of 4. Stripped in Base64URL. |
Why the string ends in one or two =
Input arrives in 3-byte groups. Whatever bytes are left over dictate the padding — the decoder reads it to know how many real bytes the final group carried.
xxxxNo padding — the group is exactly full.xxx=One '=' carries the missing byte.xx==Two '=' carry the missing two bytes.The official test vectors — the encoder’s promise
RFC 4648 §10 defines these exact outputs. Any encoder — this one, a standard library, a coworker’s regex — must land on the same strings or it is not Base64. We ran every row through Node’s buffer implementation before publishing this page; a mismatch anywhere in the table means the table is wrong, not the spec.
| Input | Bytes | Base64 |
|---|---|---|
| f | 1 | Zg== |
| fo | 2 | Zm8= |
| foo | 3 | Zm9v |
| foob | 4 | Zm9vYg== |
| fooba | 5 | Zm9vYmE= |
| foobar | 6 | Zm9vYmFy |
Sanity check yourself: "foobar" → Zm9vYmFy is the string every Linux terminal spits out. Memorize that one — it catches wrong tooling instantly.
Base64URL swaps the last two symbols
Standard Base64 uses + and / — both reserved characters in URLs. Base64URL replaces them with - and _ and usually drops the padding. Same 6-bit grouping, different 2 slots, no =.
| Standard | Base64URL | |
|---|---|---|
| 62 / 63 | + / | - _ |
| Padding | = required | usually stripped |
| "foob" | Zm9vYg== | Zm9vYg |
Decoding a JWT header or an Authorization cookie with the standard decoder dies on the first - or _. Swap those two characters for + and / and decode again — or use the JWT Decoder built for exactly this.
It always comes out one-third bigger
Output length is exactly 4 × ceil(n ÷ 3) characters, padding included. A clean multiple of three grows by exactly 4/3 — everything else rounds up at the tail.
| Input | Output | Growth |
|---|---|---|
| 3 bytes | 4 chars | 1.333× |
| 300 bytes | 400 chars | 1.333× |
| 1,000 bytes | 1,336 chars | 1.336× (odd trailing group adds padding) |
| 1 MB (1,048,576 B) | 1,398,104 chars | 1.333× — always 4 × ceil(n ÷ 3) |
Not encryption — ever
Base64 is reversible by design and by anyone. Credentials inside a Basic Auth header cross the wire in the clear unless TLS wraps them. Treat every decoded secret as compromised; hash, encrypt, or rotate — never “just Base64 it.”
Worked example: an HTTP Basic Auth header
The browser sends username:password as Base64 — foo:bar becomes Zm9vOmJhcg==. Paste the header value into this page’s decoder and read the credentials back — which is precisely why anyone sniffing the wire still needs TLS in front of it.