Skip to content

Base64 File Converter

Convert any file into a Base64 string, or decode a Base64 string back into a downloadable file.

Category: converter
Use Case: Embedding Small Files in JSON or CSS, Sending Files Through Text-Only Channels, Recovering a File from a Base64 Data URI
Privacy: 100% browser-based

File to Base64

Base64 to File

Recommended Settings

Pro Tips

  • Large files produce very long Base64 strings - roughly 33% larger than the original file size
  • A data: URI prefix (like data:image/png;base64,) is automatically stripped before decoding, so you can paste it straight from a browser or CSS file
  • Since the original filename and file type aren't stored in raw Base64, you'll need to specify the correct filename and extension when converting back to a file
  • Everything happens locally - your file's contents never leave your browser, even temporarily

Most Popular

Most people convert a small image to Base64 for embedding directly in HTML or CSS as a data URI

When to Use This Tool

Embedding Small Files in JSON or CSS

Convert a small icon or file to Base64 for inline embedding in a data URI.

Sending Files Through Text-Only Channels

Turn a file into text so it can be pasted somewhere that only accepts plain text.

Recovering a File from a Base64 Data URI

Decode a data: URI copied from a browser or email back into an actual downloadable file.

Debugging File Encoding Issues

Inspect exactly what bytes a file's Base64 representation contains.

How It Works

1

Read the file's raw bytes directly in your browser using the File API

2

Encode those bytes into a standard Base64 string, or decode a Base64 string back into raw bytes

3

For decoding, package the resulting bytes into a downloadable file using your chosen filename

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Client-side File API and Base64 encoding for optimal performance on modern browsers.

Open Source

Built with verified, open-source libraries. Fully transparent.

Frequently Asked Questions

Is there a file size limit?

There's no hard limit enforced by the tool, but very large files can be slow to process and produce extremely long Base64 strings, since your browser holds the entire file in memory.

Does the Base64 output include the file type?

No, this produces raw Base64 without a data URI prefix. If you need a data URI, prepend data:<mime-type>;base64, followed by the output.

Why do I need to specify a filename when decoding?

Raw Base64 data doesn't store the original filename or extension, so you need to provide one to get a properly named and typed file back.

Is my file uploaded anywhere?

No. The entire conversion happens locally in your browser - files are never uploaded to any server.