File to Base64

Encode PDF, ZIP, images and any local file as Base64 without changing its bytes. Copy or download the text, with optional Data URI prefix, padding and line wrapping.

Encode
Input0 characters
Result

Your result will appear here.

How to encode a file as Base64

  1. Choose a local file or drag it into the input area; the limit is 32 MiB per file.
  2. Choose plain Base64 or enable the Data URI prefix. Set padding and line wrapping for the receiving system.
  3. Encode the file, then copy the complete result or download it as a text file.

Working with File to Base64

The file is read locally as bytes, not as text. This keeps archives, documents and other binary files intact. The browser limit is 32 MiB per file; encoded output is larger than the original.

A text file encoded as Base64

Input
example.txt (UTF-8) Hello, world! 👋
Result
SGVsbG8sIHdvcmxkISDwn5GL

Questions about File to Base64

Can I encode PDF, ZIP, Word and other binary files?

Yes. Any file up to 32 MiB can be read as bytes, one file at a time. PDF documents, ZIP archives, office files and images do not need to be readable as text. Encoding does not convert, decompress or inspect their contents.

Should I use plain Base64 or a Data URI?

Use plain Base64 when an API, JSON field or other system expects only encoded data. Enable Data URI only when the receiver needs a data:…;base64, prefix. The tool infers a MIME type from file contents; unrecognised binary formats use application/octet-stream. It does not generate a JSON object automatically.

Why is the result larger, and which settings should I choose?

With padding and no wrapping, n bytes produce 4 × ceil(n / 3) Base64 characters. A Data URI prefix and line breaks add more. Leave wrapping off for most JSON and API fields; 64- or 76-character lines are available when required. Keep = padding unless the receiving protocol permits omission.

How do I restore the original file? Is Base64 encryption?

Use Base64 to File to recover the same bytes, then compare SHA-256 hashes if needed. Base64 is reversible encoding, not encryption or compression. The original filename and folder are not stored in plain Base64; preserve them separately if you need them.

Are my files, tokens or text uploaded?

No. These tools process your input in your browser. The website serves the page and its code, but your input is not sent to a conversion server or saved in an account.

  • Base64 to File

    Turn Base64 strings and Data URIs back into downloadable files without changing the decoded binary data.

  • Image to Base64

    Convert PNG, JPEG, GIF, WebP, SVG and other recognised image files to Base64 Data URIs in your browser.

  • SHA-256 Hash & File Checksum

    Generate SHA-256 hashes for text or files and check a downloaded file against its published checksum.

Explore all developer tools

Encoding & Files

Move between text, bytes, URLs and embedded images without changing your original data.

Data & Text Inspection

Read structured data, inspect tokens and understand exactly what changed.

Hashes, IDs & Schedules

Check file integrity, generate identifiers and make sense of times and recurring schedules.

Your input and files are processed on your device. Keep sensitive results out of shared clipboards and use a trusted device for private keys and tokens.