File to Base64 Encoder
Read a local file and encode its bytes as Base64 text or a Data URL. Processing takes place locally in your browser.
Start using
File to Base64 Encoder
Encodes the bytes of exactly one selected or dropped file to Base64; it does not parse the document or convert its format. A checked-by-default option includes a complete data:MIME;base64, prefix. Uncheck it for raw Base64. Select the file and run encoding explicitly; the whole file is read in browser memory.
Verified example: a five-byte text/plain file named hello.txt containing Hello produces data:text/plain;base64,SGVsbG8= by default, or SGVsbG8= with the Data URL option off. Bytes 00 FF 80 produce AP+A. If the browser provides no MIME type, the prefix uses application/octet-stream. MIME metadata does not verify actual file content.
The result can be downloaded as a UTF-8 plain-text file named original-name.base64.txt; hello.txt becomes hello.txt.base64.txt. This download contains the displayed encoded text, including the prefix when enabled, not the original binary. Use the separate Base64 file decoder to reconstruct the original bytes.
The file-size ceiling is 64 MiB (67108864 bytes). Larger files are rejected before reading, but memory-constrained devices may struggle below that bound because bytes and encoded strings coexist. Base64 payload length is 4*ceil(byteLength/3), excluding the optional prefix, so encoding expands data by roughly one third; it is not compression.
An empty file is valid: raw output is an empty string, while Data URL mode retains its prefix. A failed run disables the prior download, and Clear removes the selection and disables downloads. Processing stays local; Base64 is reversible encoding, not encryption or a security boundary. No OCR, batch encoding or character-set selector is offered. On mobile begin with a small file. Preserve Base64 case and padding; local decimal/date conventions do not alter encoded bytes.
This encoder accepts files up to 64 MiB, but this site’s file decoder accepts at most 48 MiB of Base64 text, corresponding to at most 36 MiB of original bytes. Use smaller files for an on-site round trip; larger encoded files need a decoder with suitable limits.
Processing takes place locally in your browser.