What is the Base64 Encoder/Decoder?
Base64 is a way to encode binary data as ASCII text so it can travel through email, URLs, JSON, or anywhere that only handles printable characters. This tool encodes text or files to Base64 (standard, URL-safe, and MIME variants side by side) and decodes Base64 back to text or binary, with image preview for image bytes and a hex dump fallback for unrecognizable binary.
Most online encoders only do standard Base64. We show all three variants at once, sniff decoded bytes for image magic numbers (PNG, JPEG, GIF, WebP, BMP, SVG, PDF) so you get a live preview, and render a hex dump when text decoding fails. Everything runs in your browser. Your data never leaves the page.
How it works
Features
Why this codec
Most tools only show standard. Need URL-safe for a JWT? Need MIME wrapped? Both visible at once.
Pasted a long Base64 string from CSS? See it as an image immediately. No copy-paste to a separate viewer.
Decoder works on binary too. Hex view with ASCII column lets you debug encoded protocols, file headers, anything binary.
Sensitive tokens, signed payloads, image data, leaked credentials -none of it leaves your laptop.
Who uses it
Real use cases
- You're debugging a CSS data: URL that's supposed to be a small icon. Paste the Base64 portion, see the image render. Saves a Photoshop trip.
- You got a JWT in an Authorization header and need to read the payload. Paste the middle segment -instant JSON view.
- Your API is rejecting a signed request and you suspect URL-safe encoding mismatch. Paste your token, both standard and URL-safe forms render -confirm what your server expects.
- You're encoding a small image for an email signature inline. Drop the PNG, copy the standard Base64 string, paste into the <img src='data:image/png;base64,...'> tag.
- An old SOAP integration sends you base64 of a zip file. You paste -text preview shows garbage, hex dump shows PK header (50 4B), so you know it's a zip. Decode it via download.
- You're learning OAuth/JWT and want to understand why URL-safe Base64 exists. Type a JSON payload, watch standard vs URL-safe diverge on the +/- chars.
Compared with other Base64 tools
| Feature | Molixa | base64encode.org | base64decode.org | DenCode |
|---|---|---|---|---|
| 3 variants side by side | Yes | Standard only | Standard only | Yes |
| Image preview on decode | Yes | No | No | No |
| Hex dump fallback | Yes | No | No | No |
| File encode (drop file) | Yes | Yes (paid?) | No | Yes |
| Auto-detect variant | Yes | No | No | No |
| Free, no signup, no ads | Yes | Ads | Ads | Free |
| Browser-only | Yes | Server-side | Server-side | Yes |
Frequently asked questions
Is the Base64 encoder/decoder free?▾
Yes. Unlimited use, no signup, no daily cap. Encoding and decoding run in your browser. Base64encode.org is free but ad-supported and ships your data to a server; we don't.
What's the difference between standard and URL-safe Base64?▾
Standard Base64 uses A-Z, a-z, 0-9, +, /, and = padding. URL-safe (RFC 4648 §5) replaces + with - and / with _ so the result fits in URLs and JWT tokens without percent-encoding. Padding (=) is also usually dropped. We show both side-by-side.
Can I encode a file?▾
Yes. Drop any file (image, PDF, archive) up to about 50MB and the tool reads its bytes via the FileReader API and produces the Base64 string. For images, the decode side will show a live preview.
Why do I see an image preview?▾
When you decode Base64 that came from an image, we sniff the magic bytes (89 50 4E 47 for PNG, FF D8 FF for JPEG, etc.) and render it as a data: URL. Useful for debugging email attachments or data: URIs from CSS.
What's the hex dump for?▾
When decoded bytes aren't valid text (e.g. a zip or executable), the text preview shows replacement characters. The hex dump shows the actual byte values in 16-byte rows with offset and ASCII columns, like Unix's xxd. First 256 bytes shown for readability.
Does it support large inputs?▾
Up to about 50MB depending on browser memory. The btoa/atob primitives are fast but Chrome / Firefox cap the string length around 256MB. For genuinely large files, command-line base64 is faster, but we handle most use cases comfortably.
What text encodings does it support?▾
UTF-8 (default, modern web), Latin-1 (single-byte legacy), UTF-16 LE (Windows files). Toggle on the encode side; the decode side auto-falls-back. Most inputs are UTF-8 these days.
Is my data sent to a server?▾
No. The encoder runs btoa() on UTF-8-encoded bytes. The decoder runs atob() on the input. Both are browser-native. There's no API call, no log, no telemetry. Even your file uploads stay local via FileReader.
What about MIME / line-broken Base64?▾
Supported. Some old email standards wrap Base64 at 76 characters. We render that variant too. The decoder strips any whitespace before decoding so you can paste any of the three formats.
Can I decode JWT tokens?▾
Yes for the visible parts. JWTs are three Base64URL-encoded strings joined by dots (header.payload.signature). Paste the whole token and we decode each segment. Note: signatures verify the contents but aren't human-readable; the header and payload are JSON.
Encode or decode now
3 variants, image preview, hex dump, browser-only. Free unlimited.
Open the Base64 codecThe Base64 Encoder/Decoder page is built, reviewed, and maintained by the Molixa team. We use the tool we ship and update the docs when the behavior changes.
Related Developer Tools
JSON Formatter & Validator
Format, validate, tree-view, schema-gen, type-gen, diff. 100% browser-side.
Regex Tester
Live regex tester with multi-flavor compare and click-to-insert cheatsheet.
CSS Gradient Generator
Create beautiful CSS gradients with a visual editor.
JWT Decoder
Decode + sign + verify HS256/384/512 in browser.
SQL Formatter
5 dialects, auto-detect, 3 keyword-case modes, browser-only.
QR Code Generator
20+ QR types with styling, logo, scanner, batch CSV, and scannability score.
Popular Tools
AI Content Detector
Check if text was written by AI with a sentence-by-sentence heatmap.
YouTube Video Summarizer
Turn any YouTube video into clear notes with chapters, quotes, chat, and flashcards.
PDF Summarizer
PDF summarizer with page citations, multi-doc compare, and domain templates.
AI Text Rewriter
Paraphrase in 10 modes with diff view, freeze words, and brand voice training.
AI Math Solver
Free math solver with step-by-step solutions, photo upload, and 4 learning modes.
Watermark Remover
Brush over a watermark or object and remove it cleanly with AI. Pro/Plus.
From the blog
- Base64 Encode, Decode, and Inline ImagesBase64 turns binary into text so it travels safely in URLs, JSON, and CSS. Here is how to encode and decode it, the three variants that trip people up, and when to inline.Read article
- How to Decode a JWT (Decode vs Verify)Anyone can base64-decode a JWT and read it; that is not the same as verifying it. Here is the difference, the attacks that exploit the gap, and how to decode safely.Read article
- How to Format SQL Query Output for ReadabilityA wall of unindented SQL hides bugs. Here is how to format a query the dialect-aware way, with a free formatter that auto-detects PostgreSQL, MySQL, T-SQL, and more.Read article