Base64 Encoder / Decoder

Encode text or a file to Base64, or decode Base64 back to its original, instantly in your browser. Base64 turns binary data into plain ASCII so it can travel safely inside JSON, data URIs, JWTs, or HTTP headers. Everything runs on your device, so even sensitive payloads stay private.

Base64 examples (UTF-8 input)

Input textBase64
ManTWFu
hiaGk=
Hello, World!SGVsbG8sIFdvcmxkIQ==

When to use it

  1. Embed a small image or font in CSS or HTML as a data URI.
  2. Inspect or build the payload of a JWT or an HTTP Basic Auth header.
  3. Move binary data through a text-only channel like JSON or email.

How to Use

  1. Select the operation tab: Text Encode/Decode, File to Base64, Base64 to File, or Image.
  2. Paste your text or upload your file into the input area.
  3. Choose your character encoding (UTF-8 is recommended for most use cases).
  4. Click Encode or Decode to process your data instantly.
  5. Copy the result or download it as a file.

Features

  1. Encode and decode text using Base64 with multiple character encoding options
  2. Convert any file to a Base64 string for embedding in HTML, CSS, or JSON
  3. Reconstruct files from Base64 data with automatic MIME type detection
  4. URL-safe Base64 mode that replaces + and / with - and _
  5. Image preview for Base64-encoded images
  6. 100% client-side — your data never leaves your browser

FAQs

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It's commonly used to embed image data in HTML/CSS, send binary data in JSON, or encode email attachments.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. It does not provide any security — it simply converts data to a text-safe format. Anyone can decode Base64 data.

Why does Base64 increase file size?

Base64 encoding increases data size by approximately 33% because it uses 4 ASCII characters to represent every 3 bytes of binary data.

What is URL-safe Base64?

URL-safe Base64 replaces '+' with '-' and '/' with '_' so the encoded string can safely be used in URLs and filenames without needing percent-encoding.

What character encodings are supported?

This tool supports UTF-8, ASCII, ISO-8859-1 (Latin-1), and Windows-1252. UTF-8 is the recommended default as it supports the full Unicode character set.

Can I encode/decode files?

Yes! Use the 'File to Base64' tab to convert any file to a Base64 string, or 'Base64 to File' to reconstruct a file from Base64 data. You can also specifically work with images using the dedicated image tabs.

Technical Details

Base64 encoding transforms binary data into ASCII characters using the btoa() function, which maps every 3 bytes (24 bits) into 4 printable characters from the Base64 alphabet. Decoding reverses this with atob(), converting the ASCII representation back into binary. For file encoding, the FileReader API reads uploaded files as ArrayBuffers, then Uint8Array views chunk the binary data for efficient Base64 conversion. Image previews are generated by constructing Data URIs (data:image/png;base64,...) that embed the encoded string directly into src attributes. The tool handles padding edge cases and supports both standard and URL-safe Base64 variants.

From the Blog

  • Why Browser-Based Tools Are the Future of Productivity
  • Developer Tools That Save You Hours Every Week
  • Privacy and Security: Why Client-Side Processing Matters

Developer Tools

Developer Tools

  • URL Encoder / Decoder
  • CSS Minifier
  • JS Minifier
  • HTML Minifier
  • Markdown Editor
  • SVG to Vector Drawable
  • API Tester
  • Image to Base64