Converters
Base64 File Converter
Encode a local binary file as Base64 or recover bytes as a download. Check input limits, padding, filenames, and why binary data differs from UTF-8 text.
About this tool
When to use it
Encode a local binary file as Base64 or recover bytes as a download. Check input limits, padding, filenames, and why binary data differs from UTF-8 text.
How to use it
Choose File to Base64 and select a nonempty local file. Copy the encoded text or download a .base64.txt file. To recover bytes, switch to Base64 to file, paste the Base64 text, choose the original filename and extension, then select Decode and download. Switching modes clears the workspace. A filename labels the bytes; it does not convert their format.
Guide updated . Examples checked against this implementation.
Worked examples
Recover a small text fixture
Input
SGVsbG8=
Download filename: greeting.txtExpected output
HelloThe downloaded file contains five bytes, with no trailing newline. Selecting that file in File to Base64 produces SGVsbG8= again.
Preserve bytes that are not text
Input
AP8B
Download filename: fixture.binExpected output
Hexadecimal bytes: 00 FF 01The download contains exactly three bytes. It is not a UTF-8 string; use this file workspace rather than the text Base64 decoder.
Errors and unsupported input
data:image/png;base64,iVBORw0KGgo=Remove the data URL prefix and supply only its Base64 portion. This sample is just a PNG signature, not a complete image; obtain the full source before downloading.
a=== or _w==Use complete standard Base64 with + and / and valid padding. Base64URL uses a different alphabet. Do not guess missing bytes from a truncated value.
An empty file or a file larger than 5 MiBSelect a nonempty file up to 5,242,880 bytes. A rejected selection clears the old encoded result so it cannot be mistaken for the new file.
Continue this workflow
- Base64 Encoder & Decoder: Encode and decode readable UTF-8 text directly without a file download.
- JWT Parser: Inspect a complete JWT whose segments use Base64URL.
Format references
Questions
Frequently asked questions
Why does the Base64 text look larger than the original file?
Three source bytes become four Base64 characters, with padding for a partial final group. The output therefore needs roughly one third more space.
Will a .png filename turn arbitrary bytes into an image?
No. Recover the complete original image bytes and choose its matching extension. This tool does not transcode or repair files.