Base64 Encoder and Decoder

Help Us Improve! Found a bug or have suggestions? Connect with us on X (Twitter) or LinkedIn.

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters. This tool provides secure, client-side encoding and decoding of text and files with support for UTF-8 characters, URL-safe encoding, and file processing.

Secure Processing

All encoding/decoding happens in your browser - no data is sent to servers

UTF-8 Support

Full support for international characters and emojis

File Processing

Convert files up to 10MB including images and documents

Quick Examples

Text Encoding
Hello → SGVsbG8=

Basic text to Base64 conversion

URL-Safe Encoding
Hello?→ SGVsbG8_

Safe for URLs and filenames

UTF-8 Support
こんにちは → 44GT44KT44Gr44Gh44Gv

Multi-language support


                        

Practical Examples

Data URI for Images

<img src="data:image/png;base64,iVBORw0KGgo..." alt="Base64 Image">

JWT Token Structure

header.eyJzdWIiOiIxMjM0NTY3ODkwIn0.signature

API Authentication

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

How to Use This Tool

Text Encoding

  1. Enter or paste your text in the input area
  2. Choose URL-safe option if needed
  3. Click "Encode to Base64"
  4. Copy the encoded result
Example:
Input: Hello World
Output: SGVsbG8gV29ybGQ=

File Processing

  1. Switch to "File" tab
  2. Upload or drag & drop your file
  3. Download the encoded text file
  4. Use "Decode" to restore files
Ideal for embedding images in CSS/HTML or preparing files for API transmission

Technical Guide

Base64 Encoding Process

  1. Convert input to binary data
  2. Split into 6-bit chunks
  3. Map to Base64 alphabet (A-Z, a-z, 0-9, +, /)
  4. Add padding (=) if needed
Example:
Text: Man
Binary: 01001101 01100001 01101110
6-bit: 010011 010110 000101 101110
Base64: TWFu

Common Use Cases

  • Data URIs: Embed images in HTML/CSS
  • API Tokens: JWT and authentication
  • Email: MIME attachments
  • Binary Data: Safe text transmission
Data URI Example:
data:image/png;base64,iVBORw0KGgo...

Best Practices

When to Use Base64

  • Embedding small images (< 1KB)
  • Sending binary data as text
  • Creating data URIs
  • Encoding authentication tokens

When Not to Use Base64

  • Large files (increases size by ~33%)
  • Already text-safe data
  • When bandwidth is limited
  • Critical performance scenarios

Implementation Examples

JavaScript
// Encode
const encoded = btoa('Hello, World!');
console.log(encoded); // SGVsbG8sIFdvcmxkIQ==

// Decode
const decoded = atob('SGVsbG8sIFdvcmxkIQ==');
console.log(decoded); // Hello, World!
Python
import base64

# Encode
encoded = base64.b64encode(b'Hello, World!')
print(encoded) # b'SGVsbG8sIFdvcmxkIQ=='

# Decode
decoded = base64.b64decode('SGVsbG8sIFdvcmxkIQ==')
print(decoded) # b'Hello, World!'