Base64 Encoder & Decoder

Encode and decode Base64 strings, files and images instantly. Supports multiple charsets, URL-safe format, and image preview.

Home/Tools/Base64
Loading…

What is Base64?

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, +, /). It is widely used to embed images in CSS or HTML, transmit binary data in JSON APIs, encode email attachments, and store cryptographic data in text files.

How to Use This Tool

  1. Select a mode: Text, File, or Image
  2. Paste or upload your content in the Input area
  3. In Text mode, click Auto to let the tool detect and convert automatically, or manually click Encode or Decode
  4. Copy or download the result from the Output area
  5. For non-ASCII text, open Advanced and set the correct Charset to avoid garbled output

Features

  • Auto Detect — automatically recognises Base64 input and decodes it
  • File Upload — convert any text file to Base64 and download the result
  • Image Upload & Preview — upload an image and see a live preview with resolution, type, and file size
  • Paste Base64 Image — paste a data-URI or raw Base64 in Image mode to render a preview
  • Charset Support — encode/decode with UTF-8, GBK, Shift_JIS, and more
  • URL-Safe Base64 — output RFC 4648 §5 format suitable for URLs and filenames
  • Swap — instantly move output back to input for chaining operations
  • 100% Browser-Based — your data never leaves your device

FAQ

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable characters. Every 3 bytes of binary data are encoded as 4 Base64 characters, so the output is roughly 33% larger than the original.

How do I encode text to Base64?

Switch to Text mode, paste your text, and click Encode. The Base64 result appears in the Output field instantly.

How do I decode a Base64 string?

Paste your Base64 string and click Decode, or use Auto — the tool detects Base64 input and decodes it automatically.

How do I convert an image to Base64?

Switch to Image mode and drop your image file or click Choose Image. The tool generates the Base64 string and shows a live preview.

What is Base64URL?

Base64URL is a URL-safe variant that replaces + with - and / with _, and omits padding (=). It is safe to use in URLs, JWT tokens, and filenames.

Why is my decoded text garbled?

Garbled output usually means the charset used for decoding does not match the original encoding. Open Advanced and try a different Charset — for example GBK for Simplified Chinese or Shift_JIS for Japanese.