Tools

Home
Case ConverterWord CounterCharacter CounterFind & ReplaceSort ListRemove Empty Lines

Base64 Encoder & Decoder

Encode text or files to Base64, decode Base64 strings back to text or binary — all in your browser

Your files never leave your browser
Input (Text)0 chars

Drop a file here or click to browse

Any file type supported
Output (Base64)0 chars
Ready·

Paste 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

Paste Text or Drop File
➔
Pick Encode or Decode
➔
Copy or Download Result

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.

INPUT
Hello, World!
OUTPUT
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.

INPUT
eyJ1c2VySWQiOiIxMjM0NSIsInJvbGUiOiJhZG1pbiJ9
OUTPUT
{"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.

INPUT
logo.png (2.4 KB file)
OUTPUT
data:image/png;base64,iVBORw0KGgo...

Who Uses This

👨‍💻 Developers

Debugging encoded API payloads and embedding small assets directly in CSS or HTML source.

⚙️ DevOps Engineers

Encoding TLS certificates and secrets for Kubernetes configs and CI/CD pipeline variables.

🔎 QA Testers

Decoding Base64 blobs in test responses to check actual content without writing throwaway scripts.

📧 Email Marketers

Inlining small images as data URIs so they show up even when email clients block remote loading.

Common Mistakes

Decoding something that isn’t actually Base64

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.

Leaving the data URI prefix in when decoding

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.

Thinking Base64 is encryption

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

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.

Share: