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.
data:text/plain;base64,…) and recover the original text. The decoder strips the data URI prefix automatically and handles whitespace-padded input.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.
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.
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.
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.
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.
From front-end developers embedding images in CSS to security engineers inspecting JWT payloads, Base64 encoding appears across the entire software stack.
Common encoding facts, size ratios, and format prefixes — bookmark for quick reference.
| Input | Encoded Output | Output Size | Notes |
|---|---|---|---|
| "Hello" | SGVsbG8= | 8 chars | 5 bytes → 8 chars (3 bytes = 4 chars, padded) |
| "Man" | TWFu | 4 chars | 3 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 image | data:image/png;base64,… | +33% | CSS/HTML inline: prefix with data URI |
| PDF document | data:application/pdf;base64,… | +33% | Embed in <embed> or send via API |
| JWT payload | eyJ… | variable | URL-safe Base64, no padding (=) |
| Basic Auth | dXNlcjpwYXNz | +33% | Standard Base64 of "user:pass" |
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.
Tried the tool? Leave a quick rating and help others find it.
All tools at I7 Pixel run in your browser — no uploads, no accounts, always free.