Base64 Encoder & Decoder

Encode text or files to Base64, or decode Base64 back to text or a file. Nothing is sent to a server — everything runs in your browser.

Input text
Output Base64

How to use

  1. Choose a mode: "Text → Base64" (encode) or "Base64 → Text" (decode).
  2. Input: Paste text on the left, use "Open file" to encode a file to Base64, or drag a file onto the page.
  3. Check the result: The converted result appears on the right in real time. Turn on URL-safe (-_) if you need Base64 that's safe to use in a URL or filename.
  4. Export: Copy the result to your clipboard or download it as a file. Decoded output downloads as the original raw bytes, so binary files like images can be restored correctly.

Everything runs inside your browser (JavaScript) — nothing you enter is sent to a server or stored.

What is Base64?

Base64 is an encoding scheme that represents binary data using 64 safe ASCII characters (A-Z, a-z, 0-9, +, /). It's used to safely carry binary data through text-only channels — email attachments, image data URIs, JWT tokens, API authentication headers, and more. When Base64 needs to go into a URL or filename, a URL-safe variant swaps + and / for - and _.

Frequently Asked Questions

Is my data sent anywhere?

No. All encoding/decoding happens in JavaScript inside your browser and is never sent to a server.

Does it handle Unicode text like emoji or non-Latin scripts correctly?

Yes. This tool encodes/decodes at the UTF-8 byte level, so emoji, accented characters, CJK text, and more all round-trip correctly.

Why do I get a "Not valid Base64" error?

This happens when the string contains characters outside the Base64 alphabet, or its length (including padding) isn't a multiple of 4. If it's URL-safe encoded, turn on the URL-safe option before decoding.

Can it handle binary files like images?

Yes. "Open file" can Base64-encode any file, and the "Download" button on a decode result saves the original raw bytes rather than text, so images and other binaries are restored correctly.

Why does Base64 encoding increase file size?

Base64 splits 8-bit bytes into 6-bit groups and re-represents them with 64 safe characters, which inflates the size by about 33%. It's a trade-off for safely carrying binary data through text-only channels like email or JSON.

What's the difference between standard and URL-safe Base64?

Standard Base64 uses + and /, which have special meaning in URLs and file paths (e.g. / is a path separator) and can cause problems. The URL-safe variant swaps those for - and _ and usually omits the trailing = padding, making it safe to use in query strings or filenames.