Tools
EN

File to Base64 Converter

Drop any file to encode it as Base64. Works with documents, ZIP archives, audio, video, fonts and binaries of any kind.

Drop a file here or click to chooseYou can also paste a file with Ctrl+V

Private: your data is processed in your browser and never uploaded.

How to convert a file to Base64

  1. Drop a file onto the box or click to choose one from your device.
  2. Choose raw Base64, a data URI with the MIME type, or a JSON object.
  3. Copy the result or download it as a .txt file.

Typical uses for developers

Command-line alternatives

Linux: base64 -w 0 file.zip. macOS: base64 -i file.zip. Windows: certutil -encode file.zip out.txt or PowerShell [Convert]::ToBase64String([IO.File]::ReadAllBytes('file.zip')).

Frequently asked questions

Which file types are supported?

All of them. Base64 works on raw bytes, so any file can be encoded: PDF, DOCX, ZIP, MP3, MP4, fonts, executables and more.

Are my files uploaded?

No. The file is read and encoded by your own browser. It never leaves your computer or phone.

Why add a data URI prefix?

The prefix tells browsers and other programs which type of file the Base64 contains, so it can be used directly in HTML, CSS or Markdown.