📦 Base64 Encoder/Decoder

Encode and decode Base64 strings instantly. Works with text and files. All processing happens in your browser - your data stays private.

🔍 What is Base64?

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII text format using 64 characters (A-Z, a-z, 0-9, +, /).

Example:

"Hello" → "SGVsbG8="

Base64 encoding increases size by ~33% but makes binary data safe for text-based systems.

💼 Common Uses

  • 📧Email Attachments: Encode files in emails
  • 🖼️Embed Images: Data URLs in HTML/CSS
  • 🔐API Authentication: Basic Auth headers
  • 📦Data Transfer: JSON, XML data encoding
  • 🌐URLs: Safe encoding for URLs

⚙️ How It Works

Encoding Process:

  1. Convert text to binary
  2. Split into 6-bit groups
  3. Map each group to Base64 character
  4. Add padding ('=') if needed

Character Set:

A-Z, a-z, 0-9, +, / (64 chars) + padding (=)

💻 Code Examples

JavaScript

// Encode
btoa("Hello")  // "SGVsbG8="

// Decode
atob("SGVsbG8=")  // "Hello"

Python

import base64
import { createSoftwareApplicationSchema, createFAQSchema, createHowToSchema, toolConfigs } from '../utils/structuredDataTemplates';
import RelatedTools from '../components/shared/relatedTools';
import AdSenseSection from '../components/shared/adSense';
import SecurityNotice from '../components/shared/securityNotice';
base64.b64encode(b"Hello")
base64.b64decode(b"SGVsbG8=")

🖼️ Image to Base64

Convert images to Base64 for embedding in HTML/CSS without external files:

<!-- Embed image directly in HTML -->
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA..." />

/* Or in CSS */
.bg { background: url('data:image/png;base64,iVBORw0KGg...'); }
📢
Advertisement Space
Ad will appear here

💝 Your support helps us maintain these free security tools and add new features.

Every coffee makes a difference in keeping cybersecurity accessible to everyone.