Home All Tools Dev Tools Popular Rated Browse 100+ Tools →
💡 100% private — no data leaves your browser. Works with text, images, PDFs, and any file up to 50 MB.
⚠️ Invalid Base64 input.
Charset
Line wrap
Strip whitespace on decode
✏️ Input TEXT
Chars: 0 Bytes: 0 Lines: 0
Base64 Output ENCODED
Output appears here…
Chars: 0 Size ratio:
Copied!

// Features Why Use I7 Pixel's Free Base64 Encoder & Decoder?

Base64 encoding is deceptively simple in concept but tricky in practice — wrong charset, missed whitespace, or a data URI prefix can all break a decode. I7 Pixel's Base64 tool handles every edge case automatically, runs entirely in your browser, and works with text, images, PDFs, and arbitrary binary files up to 50 MB.

✏️
Encode Text to Base64
Type or paste any text and instantly get its Base64 representation. Handles full Unicode — emoji, accented characters, CJK — via UTF-8 encoding. Character, byte, and line counts update in real time.
📎
Encode Any File to Base64
Drag and drop any file — images, PDFs, ZIP archives, binaries — up to 50 MB. The output is the raw Base64 string ready to embed in HTML, CSS data URIs, JSON payloads, or email MIME parts.
🔓
Decode Base64 to Text
Paste any Base64 string (including data URI format like data:text/plain;base64,…) and recover the original text. The decoder strips the data URI prefix automatically and handles whitespace-padded input.
💾
Decode Base64 to File
Paste Base64-encoded file data and reconstruct the original file for download. Auto-detects the MIME type from the data URI prefix or lets you select the extension manually. Preview images and text inline.
🔗
URL-Safe Base64 (RFC 4648)
Switch from standard charset (+ /) to URL-safe charset (- _) for use in JWT tokens, URL parameters, filenames, and any context where + and / must be avoided. One click — no manual substitution needed.
↩️
Line Wrap Options
Optionally wrap the Base64 output at 64, 76, or 128 characters per line — matching MIME (76), PEM (64), or custom requirements. The decoder automatically strips line breaks before decoding.
📊
Size & Overhead Stats
Every operation shows input size, output size, and the encoding ratio (typically ~1.33× for Base64). For file encoding, the overhead percentage is also shown — useful when evaluating whether Base64 is appropriate for a given payload size.
📋
Copy & Download Output
Copy the result to clipboard with one click, or download it as a .b64 text file. For decoded files, use the Decode & Download button to reconstruct and save the original file with the correct extension.
🔒
100% Client-Side Privacy
All encoding and decoding runs in JavaScript in your browser. Nothing is sent to any server. The tool works offline after the page loads. Your text, files, and Base64 strings are never logged or stored anywhere.

// Guide How to Encode or Decode Base64 — Step by Step

The tool has four modes. Here's how to use the two most common ones. All modes follow the same pattern: select, input, (optionally) configure, then copy or download.

1
Select a Mode
Click "✏️ Encode Text" to encode a string, "📎 Encode File" to encode a file, "🔓 Decode Text" to reverse a Base64 string to text, or "💾 Decode to File" to reconstruct a binary file from Base64 data.
2
Enter Your Input
For text modes, type or paste directly into the text area, or click the Paste button. For file modes, drag and drop any file onto the drop zone or click to browse. Files up to 50 MB are supported.
3
Configure Options
Choose Standard or URL-safe charset, set a line wrap length if needed (useful for MIME or PEM formats), and toggle "Strip whitespace on decode" if your Base64 input contains spaces or newlines.
4
Copy or Download
The output appears instantly. Use the Copy button for clipboard, Save to download as a .b64 file, or — in Decode to File mode — choose your filename and extension then click Decode & Download to save the reconstructed file.

// Deep Dive What Is Base64 and When Should You Use It?

Base64 is one of the most common encoding schemes in computing — yet it is frequently misunderstood, misused, or broken by small configuration errors. Here's the full picture.

⚙️

What Is Base64 Encoding?

Base64 is a binary-to-text encoding that represents arbitrary binary data using only 64 printable ASCII characters: A–Z (26), a–z (26), 0–9 (10), and two symbols (+ and / in standard mode; - and _ in URL-safe mode). Every 3 bytes of input are encoded into 4 characters of output, which means Base64 output is always ~33% larger than the original. The encoding is not encryption — it provides no confidentiality, only a safe representation of binary data in text-only channels. It is used everywhere: in HTML data: URIs, MIME email attachments, JWT tokens, CSS background images, API payloads that carry binary blobs, and HTTP Basic Authentication headers.

🔗

Standard vs URL-Safe Base64 — Which Should You Use?

The two characters that differ between variants are the 62nd and 63rd symbols of the alphabet. Standard Base64 uses + and /. These are safe in most contexts but problematic in URLs: + is interpreted as a space, and / as a path separator. URL-safe Base64 (RFC 4648 §5) replaces them with - and _, making the output safe for use in URL query parameters, JWT tokens, cookie values, and filenames — without percent-encoding. Rule of thumb: use URL-safe mode for anything that touches a URL or a filename; use standard mode for MIME parts, data URIs, and everything else.

⚠️

Common Base64 Errors and How to Fix Them

The most frequent decode failures have simple causes. Invalid character errors usually mean the data was encoded with URL-safe charset but you are decoding with standard mode (or vice versa) — switch the charset selector to match. Garbled text output when decoding a file means you should use Decode to File mode instead of Decode Text. Incorrect padding (= signs at the end) causes failures if the input was truncated — paste the full Base64 string. Extra whitespace (newlines, spaces from copy-pasting) breaks decoding — enable the "Strip whitespace on decode" toggle. Data URI prefix (e.g. data:image/png;base64,) does not need to be removed manually — this tool strips it automatically before decoding.

// Use Cases Who Uses a Base64 Encoder / Decoder?

From front-end developers embedding images in CSS to security engineers inspecting JWT payloads, Base64 encoding appears across the entire software stack.

🌐
Web Developers
Embed small images or fonts directly in HTML or CSS as data URIs to eliminate HTTP requests. Encode SVG icons, favicon.ico, or loading spinners for inline use without external files.
🔐
Security & Auth Engineers
Inspect JWT token payloads (the middle segment is Base64-decoded JSON), decode HTTP Basic Auth headers, and verify SAML assertions — all of which are Base64-encoded by specification.
📧
Email & MIME Handling
MIME email attachments and HTML email images are Base64-encoded in the raw message source. Decode them to recover the original files, or encode files to prepare them for manual MIME assembly.
🔌
API & Integration Developers
Many REST and GraphQL APIs return binary content (PDFs, images, certificates) as Base64 strings in JSON responses. Decode them to verify content, or encode files to send as API payloads.
☁️
DevOps & Config Management
Kubernetes Secrets, cloud provider configs, and CI/CD environment variables often store credentials and certificates as Base64-encoded values. Encode secrets for storage or decode them for inspection.
📚
Students & Educators
Learn how Base64 works hands-on: encode a known string, observe the 4/3 size expansion, try URL-safe vs standard charset, and see exactly which characters map to which output. The stat panel makes the encoding mechanics visible.

// Reference Base64 Quick Reference

Common encoding facts, size ratios, and format prefixes — bookmark for quick reference.

Input Encoded Output Output Size Notes
"Hello"SGVsbG8=8 chars5 bytes → 8 chars (3 bytes = 4 chars, padded)
"Man"TWFu4 chars3 bytes exactly = 4 Base64 chars, no padding
1 KB (1,024 B)~1,368 chars+33.6%Standard 4/3 ratio overhead
1 MB image~1.37 MB+33.6%Suitable for small images; avoid for large files in HTML
PNG imagedata:image/png;base64,…+33%CSS/HTML inline: prefix with data URI
PDF documentdata:application/pdf;base64,…+33%Embed in <embed> or send via API
JWT payloadeyJ…variableURL-safe Base64, no padding (=)
Basic AuthdXNlcjpwYXNz+33%Standard Base64 of "user:pass"

// FAQ Frequently Asked Questions

Answers to the most common questions about Base64 encoding, decoding, and usage.

Base64 encodes binary data into 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). Every 3 input bytes become 4 output characters, so the output is ~33% larger than the input. It is used to safely embed binary data in text-only contexts like JSON, HTML, email, and URLs.

Select "📎 Encode File", drop your image onto the upload zone, and copy the output. Then prepend the data URI prefix: data:image/png;base64, (use the correct MIME type for your image). Use it in HTML as <img src="data:image/png;base64,…"> or in CSS as background-image: url("data:image/png;base64,…").

Standard Base64 uses + and /, which have special meaning in URLs (+ = space, / = path separator). URL-safe Base64 (RFC 4648 §5) replaces them with - and _. Use URL-safe mode for JWT tokens, URL query parameters, cookie values, and filenames. Use standard mode for MIME, data URIs, and HTTP Basic Auth.

Garbled output in the Decode Text panel usually means the Base64 encodes a binary file (image, PDF, ZIP), not plain text. Switch to the "💾 Decode to File" mode, which reconstructs the binary correctly and lets you download it. Garbled characters ≠ incorrect decoding — they are the raw bytes of a binary format being displayed as text.

A JWT has three dot-separated segments: header.payload.signature. The header and payload are URL-safe Base64 (with no padding). To decode the payload: switch this tool to URL-safe charset, select "🔓 Decode Text", and paste only the middle segment (between the two dots). The result is a JSON object containing the token claims.

No — Base64 provides zero security. It is an encoding, not an encryption. Anyone who sees the Base64 string can reverse it instantly (as this tool demonstrates). Do not use Base64 to hide sensitive data. If you need confidentiality, use actual encryption (AES, RSA, etc.). Base64 is for safe transport of binary data in text channels only.

Never. All encoding and decoding runs entirely in your browser using JavaScript. No data is transmitted to any server. The page works offline after loading. Your text, file contents, and Base64 strings are completely private and not logged anywhere.

Any file type is supported — images (PNG, JPEG, GIF, WebP, SVG), documents (PDF), archives (ZIP), text files, JSON, XML, and arbitrary binary data. The maximum file size is 50 MB. For very large files, be aware that the Base64 output will be ~33% larger, so a 50 MB file produces ~67 MB of Base64 text.

// Reviews User Ratings & Feedback

Tried the tool? Leave a quick rating and help others find it.

☆☆☆☆☆
No reviews yet
5 ★
0%
4 ★
0%
3 ★
0%
2 ★
0%
1 ★
0%
Rate this tool
You already left a review. Thank you! ✓
0/400
✓ Thanks! Your review has been saved and will appear below.
Loading reviews…

// Related More Free Tools You Might Need

All tools at I7 Pixel run in your browser — no uploads, no accounts, always free.