Base64 Encoder Decoder Online

Input
0 chars0 bytes
Output
0 chars0 bytes
Click to upload or drag & drop an image
PNG · JPG · GIF · WebP · SVG
Click to upload or drag & drop any file
PDF · ZIP · Font · Video · Any format
Paste JWT Token

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into a string of printable ASCII characters. It works by grouping every 3 bytes of input into 4 characters chosen from a 64-character alphabet (A–Z, a–z, 0–9, +, /), with = used as padding.

Because many protocols — such as HTTP, email (SMTP/MIME), and JSON — were designed to handle text, Base64 provides a reliable way to embed binary data like images, fonts, and files inside text-based formats without data corruption.

How to Use This Base64 Tool

1

Choose a Tab

Select Text, Image, File, or JWT depending on what you want to convert.

2

Enter Input

Type, paste, or drag & drop your content into the input area.

3

Encode or Decode

Click Encode or Decode. The result appears instantly in the output field.

4

Copy or Download

Copy the result to clipboard or download the decoded file directly.

Features

  • Text Tab — Encode any text (including Unicode, emojis, and multi-language characters) to Base64, or decode Base64 back to readable text. Live character and byte counters show the size difference.
  • URL-safe Base64 — Replaces + with - and / with _ for safe use in URLs and JWT tokens.
  • MIME formatting — Wraps output at 76 characters per line, as required by email standards (RFC 2045).
  • Image Tab — Convert PNG, JPG, GIF, WebP, and SVG images to Base64 Data URLs. Copy as a raw string, an HTML <img> tag, or a CSS background-image value. Also decodes Base64 back to a downloadable image.
  • File Tab — Encode any file type (PDF, ZIP, font, video, etc.) to Base64, or paste a Data URL to download the original file. Supports drag & drop.
  • JWT Tab — Paste any JSON Web Token to instantly decode the Header and Payload as formatted JSON, and check whether the token has expired.
  • Validate — Check whether a string is valid Base64 before decoding.
  • 100% client-side — All processing happens in your browser. No files or data are uploaded to any server.

Common Use Cases

📷

Embed Images in CSS / HTML

Convert icons or small images to Base64 Data URLs and embed them directly in stylesheets or HTML, eliminating extra HTTP requests.

📨

Email Attachments (MIME)

Email protocols use Base64 to encode binary attachments so they can travel through text-based SMTP servers without corruption.

🔑

JWT & API Tokens

JSON Web Tokens use URL-safe Base64 encoding for their Header and Payload segments. Decode them to inspect claims and expiry.

📄

Encode Files for APIs

Many REST APIs accept file uploads as Base64-encoded strings in JSON payloads, such as PDFs, certificates, or audio files.

🗈

Embed Fonts in CSS

Use Base64 to inline web fonts inside a stylesheet with @font-face so pages render correctly even without network access.

🔒

Store Binary in JSON / XML

Databases and APIs that only support text fields use Base64 to safely store images, icons, and binary certificates.

Base64 Encoding Variants Explained

Standard Base64

Uses the full alphabet: A-Z a-z 0-9 + /, with = padding to make the output length a multiple of 4. This is the most common form, used in MIME email and data URLs.

URL-safe Base64

Replaces + with - and / with _ so the string can be used directly in URLs without percent-encoding. Used by JWTs (RFC 4648 §5).

MIME Base64 (76-char lines)

Inserts a newline (\r\n) every 76 characters as required by RFC 2045 for email body encoding. Use the "MIME lines (76)" checkbox when encoding for email.

Unpadded Base64

Strips the trailing = padding characters. Some APIs and JWT implementations use this to keep the token shorter.

Frequently Asked Questions

No. Base64 is an encoding scheme, not encryption. It is easily reversible by anyone with a decoder. Do not use Base64 to protect sensitive data — use proper encryption algorithms like AES instead.
Base64 encodes data in groups of 3 bytes. If the input is not a multiple of 3 bytes, one or two = padding characters are appended to make the output length a multiple of 4 characters.
Yes — Base64 output is approximately 33% larger than the original data. Every 3 bytes become 4 characters. This tool shows you the exact byte count before and after so you can see the size increase.
Yes. This tool uses the TextEncoder API to first convert your text to UTF-8 bytes before applying Base64 encoding, so all Unicode characters — including emojis, Arabic, Chinese, and Hindi — are handled correctly.
Your data never leaves your device. All encoding, decoding, and file processing happens entirely in your browser using JavaScript. Nothing is sent to a server.
There is no hard limit enforced by the tool — the limit is your browser's available memory. In practice, files up to a few hundred megabytes encode fine on modern browsers, though very large files may slow down the page.
After encoding your image on the Image tab, click Copy <img> tag. You will get a complete <img src="data:image/png;base64,..."> tag ready to paste directly into any HTML file.
© Innate Blogger. All rights reserved. Developed by Samik Pal