Base64 File Converter — Free Online

Convert files to Base64 and Base64 back to files with this free online tool. Supports images, PDFs, and any binary file. No sign-up required.

Drop a file here or click to upload

What is Base64 File Encoding?

Base64 file encoding converts any binary file — images, PDFs, audio, executables — into a plain-text ASCII string using the Base64 alphabet (A-Z, a-z, 0-9, +, /). This is especially useful when you need to embed binary content in text-only formats such as JSON payloads, HTML data URIs, CSS backgrounds, or email attachments. A data URI combines the MIME type with the Base64 string (e.g. data:image/png;base64,iVBOR...) so browsers can render the file directly from the string without an extra HTTP request.

How to Use This Free Online Base64 File Converter

  1. Choose a mode: 'File → Base64' to encode, or 'Base64 → File' to decode.
  2. To encode: drag and drop a file or click to upload. The Base64 output appears instantly.
  3. Toggle 'Include data URI prefix' on or off depending on whether you need the full data URI or raw Base64.
  4. Click the Copy button to copy the result to your clipboard.
  5. To decode: paste a Base64 string (with or without the data URI prefix) and click Download File.

Common Use Cases for Base64 File Conversion

  • Embedding images in HTML or CSS — Convert small icons and logos to data URIs so they load inline without additional HTTP requests, improving page performance.
  • Sending files through JSON APIs — Many REST APIs accept file uploads as Base64-encoded strings inside JSON bodies, avoiding multipart form handling.
  • Storing files in text-based databases — Some NoSQL or configuration stores only accept text values. Base64 lets you persist binary data safely.
  • Email attachment encoding — MIME email standards encode binary attachments as Base64 so they can travel through text-only email transport layers.

FAQ

What file types can I convert to Base64?
Any file type works — images (PNG, JPG, GIF, SVG, WebP), PDFs, audio files, videos, ZIP archives, and more. Base64 encoding is format-agnostic; it simply converts raw bytes to text.
Why is the Base64 output larger than the original file?
Base64 encoding increases size by approximately 33% because it maps every 3 bytes to 4 ASCII characters. For large files, consider using direct binary transfer instead.
Is my file uploaded to a server?
No. All conversion happens entirely in your browser using the JavaScript FileReader API. Your files never leave your device.
What is a data URI prefix?
A data URI (e.g. data:image/png;base64,...) embeds the MIME type alongside the Base64 string so browsers know how to interpret the data. It's required for inline images in HTML/CSS but not needed for API payloads.

関連ツール