Skip to content

File to Base64 Converter

Drop any file - PDF, DOCX, ZIP, MP3, MP4, anything - and get its Base64-encoded representation. Includes the proper MIME type prefix for use as a data URI. Encoding happens locally in your browser using FileReader - the file is never uploaded.

When to use this

Use when: embedding small file attachments in JSON / XML / GraphQL APIs, generating self-contained HTML emails with embedded PDFs, prepping fixture data for tests, transmitting binary data through text-only channels (chat, SMS, old email systems).

Frequently Asked Questions

What's the max file size?

Bounded by browser memory - most laptops handle 50-100 MB comfortably. Larger files cause the browser tab to slow. Note that the Base64 output is ~33% larger than the source file, so a 50 MB PDF becomes a 67 MB Base64 string.

Why is my Base64 output huge?

Base64 encoding always increases size by ~33% (3 bytes -> 4 chars). A 1 MB file becomes a ~1.34 MB Base64 string. If you need smaller payloads, consider gzipping the file first, then Base64-encoding the gzipped output.

Powered by Base64 Encoder / Decoder.

Other targeted versions of this tool — each tuned for a specific use case.

Or use the main Base64 Encoder / Decoder if your use case isn't covered above.