Base64 Encoder / Decoder
Encode & decode text, images and files to Base64 — with URL-safe mode, data-URI output, live preview and MIME line-wrapping.
How to Use the Base64 Encoder / Decoder
- Choose a mode — Encode to convert into Base64, or Decode to convert Base64 back.
- Pick a source — type/paste Text, or switch to File / Image and drop a file to encode it.
- Set options — turn on URL-safe for links and filenames, line-wrap for MIME/email, or add a data-URI prefix to embed images directly in CSS/HTML.
- Convert — results update live as you type, or click the button. Decoded images show a live preview.
- Copy, download or swap — save the output, download decoded files, or feed the output back as input.
What Is Base64?
Base64 is an encoding scheme that represents binary data as ASCII text using 64 characters: A–Z, a–z, 0–9, plus (+) and slash (/), with = for padding. It lets binary content travel safely through text-only systems like email, URLs and JSON APIs that can't reliably carry raw bytes.
Because Base64 expands data by roughly 33%, it isn't compression — it's a transport format. This tool handles full UTF-8 text (including emojis), files of any type, the URL-safe variant, and data URIs for inlining images and fonts.
Common Use Cases
📧Email attachmentsMIME wraps binary attachments as line-wrapped Base64.
🎨Inline images in CSS/HTMLData URIs embed images and fonts without extra requests.
🔑API authenticationHTTP Basic Auth headers encode credentials in Base64.
🎫JSON Web Tokens (JWT)Each JWT segment is Base64URL-encoded — use URL-safe mode.
💾Storing binary in textSave images or files inside JSON, XML or database text columns.
🔗URL & filename-safe dataPass encoded values in query strings and file names safely.
Why Choose Our Base64 Tool
- 📷 Files & imagesEncode any file by drag-and-drop and preview decoded images instantly.
- 🔗 Data-URI outputOne-click
data:image/…;base64,strings ready to paste into CSS/HTML. - 🌐 URL-safe variantProper Base64URL for JWTs, tokens and query strings.
- 📄 MIME line-wrap76-character wrapping for email and legacy systems.
- ⚡ Live & UTF-8 awareReal-time conversion that handles emojis and all Unicode correctly.
- 🔒 100% privateEverything runs in your browser — no uploads, no tracking.
Frequently Asked Questions
Is Base64 encryption?
No. Base64 is reversible encoding, not encryption — anyone can decode it. It's for safely transporting binary data through text systems, not for protecting secrets. Use real encryption for sensitive data.
What is URL-safe Base64?
A variant that replaces
+ with - and / with _, and usually drops the = padding, so the result is safe to use in URLs, query strings and filenames. JWTs use this variant. Toggle "URL-safe" to produce or read it.How do I encode an image to Base64?
Switch the source to "File / Image", drop your image, and the tool outputs its Base64. Tick "Add data-URI prefix" to get a ready-to-use
data:image/png;base64,… string you can paste straight into CSS or an <img> tag.Why is my Base64 larger than the original?
Base64 encodes every 3 bytes as 4 characters, so output is about 33% larger. That's expected — Base64 is a transport format, not compression.
Why does decoding fail?
Common causes are stray spaces, missing padding, or mixing standard and URL-safe characters. The decoder auto-fixes padding and URL-safe characters, but truncated or corrupted strings can't be recovered.
Does it handle emojis and non-English text?
Yes. Encoding and decoding are fully UTF-8 aware, so emojis, accents and non-Latin scripts round-trip correctly.
Is my data uploaded?
No. All encoding and decoding happen locally in your browser. Files never leave your device.
