Base64 Encoder & Decoder
Encode and decode Base64 instantly — text, images, and files with live preview, JWT decoder, code snippets for 7 languages, and 4 Base64 variants. Free, fast, and 100% browser-based — your data never leaves your machine.
How to Use the Base64 Encoder & Decoder
- Choose your mode — Select Text for strings and JWT tokens, Image for pictures with live preview and 5 output formats, or File for any binary file (PDF, ZIP, fonts, etc.).
- Set the direction — Toggle the switch to choose Encode (original → Base64) or Decode (Base64 → original). The tool auto-detects JWT tokens and shows a decoded panel.
- Enter your data — Paste text, drag-drop an image, or upload a file. Optionally select a Base64 variant (Standard, URL-safe, MIME, PEM) and charset.
- Copy, download, or get code — Click "Copy" for clipboard, "Download" to save, or use the code snippet tabs to get ready-to-use code for JavaScript, Python, PHP, Java, Go, cURL, or CSS.
About Our Free Base64 Encoder & Decoder
Base64 is the universal encoding used to embed binary data in text-based systems — from email attachments and data URIs to JWT tokens and API payloads. But most online Base64 tools are cluttered with ads, limited to text-only, or send your data to a server.
Our Base64 tool is a best-in-class, free online encoder and decoder that handles text, images, and files in one interface — with features that no single competitor offers:
- 3 modes in one tool — Text, Image, and File. No need to open separate tools for different data types.
- Bi-directional — Encode and decode with a single toggle switch. 70-75% of users need both directions.
- Image preview with 5 output formats — See your image rendered
from Base64, then copy as raw Base64, Data URI, CSS
background-image, HTML<img>tag, or JSON string. - JWT auto-decoder — Paste a JWT token and see the header, payload, and signature decoded with expiry status. No other Base64 tool does this.
- Code snippets for 7 languages — One-click copy for JavaScript, Python, PHP, Java, Go, cURL, and CSS. Stop manually wrapping your Base64 output.
- 4 Base64 variants — Standard (RFC 4648), URL-safe (Base64URL), MIME (76-char lines), and PEM (64-char lines). Full control over output format.
- Auto-detection — The tool detects whether input is plain text, Base64, JWT, or a data URI and routes accordingly.
100% browser-based — your data is never uploaded to any server.
All processing uses the browser’s built-in btoa/atob and
FileReader APIs. No file size limits (up to 10 MB), no signup, no privacy
concerns. Safe for API tokens, configuration secrets, and proprietary data.
Why Choose Our Base64 Tool Over Others?
- Privacy-first — 87% of competitor tools send your data to a server. Ours runs 100% in your browser. Your API keys, tokens, and sensitive data never leave your machine.
- No ads, no signup, no limits — The #1 and #2 complaints about competitor tools, eliminated. Clean, distraction-free interface.
- Image-to-Base64 with preview — Most tools show raw Base64 text. Ours renders the image, shows dimensions and file size, and generates 5 output formats including CSS and HTML snippets.
- JWT decoder built-in — Paste a JWT and see header, payload, and signature decoded in color-coded panels with expiration status. Developers search for this constantly.
- 7-language code snippets — Copy ready-to-use code for your language instead of manually wrapping Base64 strings.
- All file types supported — Not just text and images. Encode PDFs, ZIPs, fonts, audio, video — any binary file up to 10 MB.
- Draft persistence — Your last text input is saved in localStorage and restored automatically. Never lose work across sessions.
Common Base64 Use Cases
- Embedding images in CSS/HTML — Convert small icons and logos to Base64 data URIs to eliminate HTTP requests and improve page load speed.
- Decoding JWT tokens — Inspect JWT payloads from OAuth flows, API authentication, and SSO systems without installing a separate tool.
- Email attachments — MIME email uses Base64 to encode binary attachments. Decode them to inspect content or encode files for raw email composition.
- API payloads — Many APIs accept or return Base64-encoded binary data (images, PDFs, certificates). Encode before sending, decode after receiving.
- Data URIs in web development — Embed fonts, SVGs, and small
assets directly in CSS or HTML using
data:URIs with Base64 encoding. - Configuration and secrets — Kubernetes secrets, Docker configs, and CI/CD variables often use Base64 encoding. Decode to inspect, encode to set.
- Certificate handling — PEM-encoded certificates and keys use Base64. Decode to inspect certificate contents or convert between formats.
Frequently Asked Questions
What is Base64 encoding?
How do I encode text to Base64?
How do I convert an image to Base64?
background-image, HTML <img> tag, or
JSON string. Supports PNG, JPG, GIF, SVG, WebP, ICO, and BMP.
Is Base64 the same as encryption?
Why is Base64 output larger than the input?
What is Base64URL and when should I use it?
+ with - and
/ with _ to make output safe for URLs and filenames.
Use it when encoding data for URLs, query parameters, JWT tokens, OAuth flows, or
anywhere the characters + and / would need escaping.
How do I decode a JWT token?
exp claim and shows whether the token is valid or expired.
Can I encode any file type?
Is my data safe? Does it get sent to a server?
btoa/atob and
FileReader APIs. Your data is never uploaded, logged, or stored anywhere.
Safe for API tokens, certificates, configuration secrets, and proprietary business data.
What is the maximum file size?
base64 on Linux/Mac or
certutil -encode on Windows.