Base64 Encoder / Decoder

Encode text or files to Base64 and decode Base64 strings instantly. 100% private — runs entirely in your browser.

About This Tool

Encode and decode Base64 without a server

Base64 is everywhere — data URLs in CSS, file attachments in emails, binary payloads in REST APIs. This tool lets you encode any text or file to Base64 and decode any Base64 string back to readable text, all inside your browser.

Need to encode URLs too? Try the URL Encoder/Decoder. Working with JSON? Use the JSON Formatter.

Encode & Decode

Switch between encode and decode modes instantly with one click.

📁

File to Base64

Upload any file and get its Base64 string — images, PDFs, or any binary.

Download Decoded

Decode a Base64 string and download it as a binary file.

🔒

100% Private

No server involved — btoa() and atob() run locally in your browser.

Quick Start

How to Use

01

Choose Mode

Select Encode to turn text into Base64, or Decode to convert Base64 back to plain text.

02

Paste or Upload

Type text directly, paste a Base64 string, or click 'File to Base64' to encode any file.

03

Copy or Download

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

Use Cases

When to Use Base64 Encoder / Decoder

Base64 encoding is a fundamental technique in web development, APIs, and data transmission workflows.

🖼️

Embed Images in HTML/CSS

Encode images as Base64 strings to embed them directly in HTML or CSS without separate file requests.

🔑

API Authentication

Encode credentials or tokens in Base64 format for Basic Auth headers in API requests.

📧

Email Attachments

MIME email protocols use Base64 to encode binary attachments for safe transmission as text.

🗝️

JWT Decoding

Decode Base64-encoded JWT payload sections to inspect claims without a dedicated JWT tool.

💾

Data Storage

Encode binary data as Base64 text for storage in JSON fields, databases, or configuration files.

🔍

Debug Encoded Strings

Decode Base64 strings from logs, API responses, or config files to read their original content.

FAQ

Frequently Asked Questions

What is Base64 encoding?

Base64 converts binary data into a text string using 64 printable ASCII characters. Commonly used to embed images, files, or binary data inside JSON, HTML, CSS, or email payloads.

Does this upload my data anywhere?

No. Everything runs locally in your browser using JavaScript's built-in btoa() and atob() functions. Your data never leaves your device.

Why is Base64 output longer than the input?

Base64 expands data by ~33% because it represents every 3 bytes as 4 ASCII characters.

What is Base64 used for?

Embedding images in CSS/HTML (data URLs), encoding email attachments (MIME), passing binary data in JSON APIs, and storing small files in databases.

Related Tools