Skip to content

Base64 Encoder/Decoder

3 variants side by side, image preview, hex dump fallback.

Share
Encoding and decoding run in your browser. Data never sent.
3
Variants
Yes
Image preview
Unlimited
Free uses per day
Browser
Runs in

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

Step 1
Pick a mode
Encode text, encode file, or decode. Toggle anytime; the input swaps.
Step 2
Paste or drop
Paste text, drop any file (50MB max). Decoder accepts any of standard / URL-safe / MIME variants.
Step 3
Read the output
Three encoded variants side by side. Decoded text + image preview if image bytes detected.

Features

3 variants side by side
Standard, URL-safe (RFC 4648 §5), MIME 76-char wrapped. Toggle once, see all three.
Image preview
PNG, JPEG, GIF, WebP, BMP, SVG magic bytes detected. Live <img> rendering from the data: URL.
Hex dump fallback
When decoded bytes aren't text (zip, executable), show xxd-style hex with offset, hex pairs, and ASCII column.
Auto-detect variant
Decoder figures out if input is standard, URL-safe, or MIME. No need to pick first.
File encode
Drop any file up to 50MB. Bytes encoded via FileReader, no upload.
Text encoding choice
UTF-8, Latin-1, or UTF-16 LE on encode side. Decoder falls back gracefully.
MIME wrap
76-char wrap matches old email Base64 spec. Drop into legacy email systems.
Browser only
btoa() and atob() are browser primitives. We never touch your data on a server.

Why this codec

3 variants in one view

Most tools only show standard. Need URL-safe for a JWT? Need MIME wrapped? Both visible at once.

Image preview built-in

Pasted a long Base64 string from CSS? See it as an image immediately. No copy-paste to a separate viewer.

Hex dump for binary

Decoder works on binary too. Hex view with ASCII column lets you debug encoded protocols, file headers, anything binary.

Browser-only

Sensitive tokens, signed payloads, image data, leaked credentials -none of it leaves your laptop.

Who uses it

Backend devs
Decoding JWT tokens, debugging API auth headers, encoding binary configs.
Email integrators
Decoding base64 attachments from raw IMAP / RFC822 messages.
Data engineers
Encoding small binaries for JSON / Postgres bytea / Mongo Binary fields.
Students
Learning what Base64 actually is -character mapping, padding, why URL-safe exists.

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

FeatureMolixabase64encode.orgbase64decode.orgDenCode
3 variants side by sideYesStandard onlyStandard onlyYes
Image preview on decodeYesNoNoNo
Hex dump fallbackYesNoNoNo
File encode (drop file)YesYes (paid?)NoYes
Auto-detect variantYesNoNoNo
Free, no signup, no adsYesAdsAdsFree
Browser-onlyYesServer-sideServer-sideYes

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 codec
Built and reviewed bySaqib Zahoor, WeboTech Studio
Last updated:

The 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.