Base64 Encoder & Decoder
Encode text or files to Base64, decode Base64 strings back to text or binary — all in your browser
Drop a file here or click to browse
Any file type supportedPaste a Base64 string and decode it to readable text, or encode any text or file into Base64 — with live output as you type. The Data URI toggle adds the correct prefix and MIME type automatically, so you don’t have to piece that together yourself.
And everything runs in your browser. Nothing gets uploaded.
How It Works
Base64 takes every 3 bytes of input and maps them to 4 printable ASCII characters — letters, digits, plus sign, and forward slash. So the output is always about a third larger than whatever went in. If the byte count isn’t evenly divisible by 3, padding characters (those = signs) fill the gap. Decoding just reverses the whole thing. Quick math, no magic.
Examples
Encoding a plain text string
Passing a username through a URL query parameter that chokes on spaces and special characters.
Hello, World!SGVsbG8sIFdvcmxkIQ==Decoding a JWT payload
You grabbed a JWT from browser dev tools and want to read the middle section. It is Base64-encoded JSON. Paste it in, switch to Decode. Done.
eyJ1c2VySWQiOiIxMjM0NSIsInJvbGUiOiJhZG1pbiJ9{"userId":"12345","role":"admin"}Embedding a small image as a data URI
Your HTML email template needs a logo baked in — no external hosting, no broken images when the client blocks remote content. Drop the PNG into the encoder and flip Data URI on. The output goes straight into an <img src="..."> tag. And honestly, it saves more time than writing the prefix by hand.
logo.png (2.4 KB file)data:image/png;base64,iVBORw0KGgo...Who Uses This
Debugging encoded API payloads and embedding small assets directly in CSS or HTML source.
Encoding TLS certificates and secrets for Kubernetes configs and CI/CD pipeline variables.
Decoding Base64 blobs in test responses to check actual content without writing throwaway scripts.
Inlining small images as data URIs so they show up even when email clients block remote loading.
Common Mistakes
Random letter strings can look like Base64. But if your output is garbled nonsense, the input probably was not encoded in the first place. Real Base64 only uses A-Z, a-z, 0-9, +, / and ends with = or == padding.
Pasting data:image/png;base64,iVBOR... into a decoder that doesn’t strip prefixes gives you junk. This tool handles it automatically. But if you’re writing code, remove everything before and including the comma first.
It is not. Anyone can reverse it instantly — no key, no password. So if your passwords or API keys are only Base64-encoded, they are completely exposed. Encrypt first with AES or similar, then encode the result.
Technical Details
- Processing: 100% client-side — nothing leaves your browser
- Max Input: Limited by browser memory (tested up to 50 MB)
- Unicode: Full UTF-8 support before Base64 conversion
- Output Formats: Raw Base64 or Data URI with auto-detected MIME type
- Browser Support: Chrome, Firefox, Safari, Edge
Frequently Asked Questions
What is Base64 encoding used for?
Base64 turns binary data into plain text so it can travel through text-only channels. You see it in email attachments, embedded images in HTML and CSS, storing blobs in JSON or XML, and pushing file data through APIs that reject raw bytes. Basically any time binary needs to ride a text-only rail.
Is Base64 the same as encryption?
Not even close. Base64 is reversible by anyone — no key required. It is purely a way to represent binary as text characters. If you need actual security, encrypt your data first with something like AES, then Base64-encode the encrypted result for transport.
Why does Base64 make files about 33% bigger?
Every 3 bytes of input become 4 characters of output. That 4-to-3 ratio means a 33% size increase. Padding characters can add a tiny bit more on top. It is the trade-off for getting binary data into a format that won’t break text-based systems.
Can I encode images and PDFs to Base64?
Yes. Drag any file into the tool and it produces the Base64 string. For images like PNG, JPG, GIF, SVG, and WebP, toggle the Data URI option to get a ready-to-use string for img tags or CSS backgrounds. Works with PDFs and any other binary file too.
Is my data safe when using this tool?
Yes. Everything runs in your browser using JavaScript. Your data never gets sent to any server — open the network tab while encoding or decoding and you will see zero outgoing requests. Nothing phones home.