Base64 Encode and Decode Online

Convert text or files to Base64 and back online, right in your browser — with URL-safe output and file-to-DataURI. Nothing is uploaded.

Files stay local .txt、.b64 Max 200MB

Mobile browsers have far less memory: keep files under 100MB. Larger files can be killed mid-way with no error — use a desktop browser for those.

Plain text
Base64
Any file to DataURI:
Drag a file to load its contents
Supports .txt, .b64 ·
Drag a .txt or .b64 file into the input area

Options

Output goes straight into URLs or filenames; decoding accepts both alphabets.

What this tool does

Convert any file to Base64 or back, in your browser. Upload a file to get the Base64 text, or paste a Base64 string to recover the original file.

Everything happens locally; the file is never uploaded.

How to use

  1. Pick a mode and add your file Encode turns the file into Base64; Decode turns a Base64 string back into the original file.
  2. Choose wrapping or URL-safe if needed Wrapping at 76 chars is on by default (MIME style), as mail and curl expect. If the result goes into a URL or filename, turn on "URL-safe output" instead — it disables wrapping.
  3. Copy or download the result Encode results can be copied with one click; decode results download as a file.

FAQ

Is Base64 a form of encryption?

No. Base64 is an encoding, not encryption: its only job is to map arbitrary bytes to printable characters, and anyone who has the string can decode it.

Do you support the URL-safe (- _) variant?

Yes. Turn on "URL-safe output" and the result swaps + for -, / for _ and drops the trailing = padding, ready to drop into a URL or filename. Decoding auto-detects both alphabets.

Is my file uploaded?

No. All processing happens inside your browser; the server only serves the page.

What does a decode failure mean?

Usually the Base64 was truncated during copy, or non-Base64 characters slipped in. This tool already accepts both the standard and URL-safe alphabets and strips a leading data:...;base64, prefix, so those cases no longer fail.

How do I embed an image into a web page?

Click "Any file to DataURI", pick an image, and you get the full data:image/png;base64,… string to paste into <img src="…">. Note: data URIs do not suit very large images (most browsers cap a single URI at 4–8MB).

Limits

Up to 200MB per file, one file at a time; standard and URL-safe alphabets supported, no Base32/58/85.

Base64 is not encryption — do not use it to hide secrets or sensitive data.

Related tools