100% Private & Secure

Base64 Encoder
/ Decoder

Encode text or files to Base64 and decode Base64 back to text or binary — all processing happens instantly in your browser with full Unicode support.

Encode & decode textFile supportURL-safe optionNo upload required

 

Overview

What Is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data as a string of printable ASCII characters. Every three bytes of input become four characters of output, using the alphabet A–Z, a–z, 0–9, +, and /, with = as padding. It is one of the most widely used encoding formats on the web, appearing in data URIs, email attachments, API tokens, and configuration files.

Our Base64 Encoder / Decoder converts text and files in both directions instantly in your browser. Paste text, upload a file, toggle URL-safe mode or MIME line breaks, and get the result in one click — no sign-up, no server upload, no data collection.

The encoder supports full Unicode text using the encodeURIComponent + unescape technique, so emoji, CJK characters, and all multi-byte sequences survive the round-trip without corruption. For files, the tool reads the binary as an ArrayBuffer and encodes it in chunks for smooth performance even with large files.

The decoder auto-detects URL-safe encoding (- and _ instead of + and /), handles missing padding, and checks whether the result is text or binary. If the decoded data is an image, a live preview is rendered. If it is another binary format, you can download the file directly. Everything runs on your device — close the tab and nothing remains.

Features

Discover Features

Bi-directional encoding, URL-safe mode, file support, image preview, and full privacy — all on your device

Bi-Directional Conversion

Switch between Encode and Decode with a single tab click. Both directions handle text input, clipboard paste, and file uploads so you never need a second tool.

Full Unicode Support

Encode and decode any Unicode text — emoji, CJK characters, Arabic, Cyrillic, and more. The tool uses encodeURIComponent + unescape for lossless round-trip conversion.

URL-Safe Base64

Toggle URL-safe encoding that replaces + with -, / with _, and strips padding. Perfect for embedding Base64 in URLs, filenames, and query parameters without percent-encoding.

File Upload & Encoding

Upload any file type — images, PDFs, documents, binaries — and encode it to Base64 instantly. Large files are processed in chunks for smooth performance without freezing the browser.

Image Preview on Decode

When decoding a Base64 string that contains an image (PNG, JPEG, GIF, WebP), the tool auto-detects the format and renders a live preview right below the output.

100% Private & Secure

All encoding and decoding happens entirely in your browser. Nothing is sent to any server. Close the tab and nothing remains — ideal for API keys, tokens, and sensitive payloads.

How to Use

Four steps: choose a mode, enter input, convert, and copy or download

01
01

Choose Encode or Decode

Select the Encode tab to convert text or files to Base64, or the Decode tab to convert Base64 back to readable text or binary.

02
02

Enter or upload your input

Type, paste, or upload a file into the input area. For encoding, any text or file works. For decoding, paste a valid Base64 string.

03
03

Set options and convert

Toggle URL-safe mode or MIME line breaks if needed, then click Encode or Decode. The result appears instantly in the output area.

04
04

Copy, download, or swap

Copy the result to your clipboard, download it as a file, or hit Swap to feed the output back as input in the opposite mode.

Use Cases

Common scenarios where Base64 encoding and decoding saves time and simplifies data handling

Embedding Data in Code

Encode small images, fonts, or binary assets as Base64 data URIs to embed directly in HTML, CSS, or JavaScript — eliminating extra HTTP requests.

API Authentication

Many APIs require Base64-encoded credentials in HTTP headers (e.g., Basic Auth). Quickly encode your username:password pair for testing with curl or Postman.

Email & MIME Attachments

SMTP and MIME encode binary attachments as Base64 with 76-character line breaks. Use MIME mode to produce spec-compliant output ready for email payloads.

Database Storage

Store binary blobs (images, documents) in text-only database columns by encoding them as Base64. Decode them back when retrieving for display or download.

JWT & Token Inspection

Decode the header and payload sections of JSON Web Tokens (JWTs) to inspect claims, expiration, and issuer without needing a dedicated JWT debugger.

Data Transfer & Debugging

Copy binary data between systems that only support text (chat, tickets, config files). Base64 guarantees safe transport through any text-based channel.

Compare Plans

Free vs Paid — Base64 Encoder

Get started free, upgrade when you need more power.

Feature
Free
Paid
Daily usage
5 uses/day
Unlimited
File size limit
10 MB
Up to 500 MB
All core features
No software installation
Works on any device
Files stay on your device
Batch processing
Priority support
Upgrade to Full Version

Unlock the Full Power of Base64 Encoder

Remove daily limits, process larger files up to 500 MB, enable batch processing, and get priority support.

Developer Tools includes:

  • 13 developer & utility tools
  • Unlimited daily uses
  • No file size limits
  • All output formats

Also available in the All Tools Bundle

FAQ

FAQ

Frequently asked questions about the Base64 Encoder / Decoder

Q1. What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /) plus = for padding. It is widely used for embedding binary data in text-only formats like JSON, XML, HTML, and email.
Q2. Is my data safe?
Yes. All encoding and decoding runs entirely in your browser using JavaScript. Nothing is sent to any server. Your data never leaves your device — close the tab and it is gone.
Q3. What is URL-safe Base64?
URL-safe Base64 replaces + with - and / with _, and removes trailing = padding. This makes the output safe to use in URLs, query parameters, and filenames without percent-encoding. The decoder auto-detects URL-safe input and converts it back before decoding.
Q4. Why does Base64 make data larger?
Base64 encodes every 3 bytes of input into 4 ASCII characters, resulting in roughly a 33% size increase. This trade-off is intentional — it ensures the data consists only of printable characters that survive transport through text-based systems.
Q5. Can I encode files, not just text?
Yes. Click 'Upload file' to select any file — images, PDFs, executables, archives. The file is read as an ArrayBuffer and encoded to Base64 in chunks. Large files (several MB) work fine, though very large files may take a moment.
Q6. How does the tool handle Unicode text?
The encoder uses encodeURIComponent + unescape before btoa to convert multi-byte Unicode characters into a byte sequence that btoa can handle. The decoder reverses this with escape + decodeURIComponent. This ensures lossless round-trip encoding of emoji, CJK, and all other Unicode.
Q7. What are MIME-style line breaks?
MIME (RFC 2045) requires Base64 output to be wrapped at 76 characters per line. Enable the 'Line breaks every 76 chars' toggle to produce MIME-compliant output, which is needed for email attachments and some legacy systems.
Q8. What happens when I decode a binary file?
If the decoded data is binary (not readable text), the tool shows a 'Download as File' button instead of a text preview. If the data is a recognized image format (PNG, JPEG, GIF, WebP), a live image preview is also displayed.
More tools

Related Tools

Encode and decode Base64, then try these other utility tools