Toolvore

File to Base64

Encode files locally as Base64 or data URLs, compare SHA-256 and download the full text.

This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.

Encode a local file as standard Base64, Base64URL or a data URL, with exact-byte SHA-256 verification and full text downloads.

How to use it

  1. 1Choose one file up to 10 MiB or use the binary example.
  2. 2Choose raw Base64 or a data URL; adjust raw alphabet and padding if required.
  3. 3Inspect the original size, output length and SHA-256 fingerprint.
  4. 4Copy or download the full output; the preview alone is capped at 24,000 characters.

Example

Input
Bytes 00 ff 10 41 42
Output
AP8QQUI=

Five original bytes; eight padded Base64 characters.

What happens to your data

Files are read and hashed locally without content upload or browser-storage persistence. Page assets and anonymous usage events may use the network. Base64 is not encryption.

Last updated October 2026

Turn a local file into raw Base64 or a Base64 data URL without changing its original bytes. Choose standard or URL-safe output, control padding for raw values, inspect the exact size and download the full encoded text. The SHA-256 fingerprint gives you a practical way to compare the original with a later decoded copy.

Use this for a small binary API fixture, an attachment field that requires Base64, or debugging an application that handles files as text. It does not convert document formats, compress files, remove embedded metadata or encrypt sensitive information.

How it works

Choose one file up to 10 MiB, or use the five-byte example. Encoding starts after selection and works on the file bytes directly, so a leading zero, non-UTF-8 bytes and an empty file are preserved. Switching output format recomputes the text from those same bytes. Selecting a different file immediately removes the previous result; Clear also cancels any in-progress result from appearing.

Standard Base64 uses + and /; Base64URL replaces them with - and _. Required = padding can be omitted for raw output when the receiving protocol permits it. A data URL always uses standard, padded Base64 and includes a MIME label. That label comes from the browser, with application/octet-stream as the fallback. It is not proof of the actual file format, safety or completeness.

Padded Base64 has 4 × ceil(byte count ÷ 3) characters, before the data URL header. A five-byte file therefore becomes eight characters; large inputs grow by roughly one third. The preview shows at most 24,000 characters, but copying or downloading retains the full value. An empty file correctly produces empty raw Base64; Download full text can save it even though there is nothing to copy.

SHA-256 is computed from the original bytes, not the encoded text. Decode the result with Base64 to File and compare fingerprints to check a round trip. A matching fingerprint does not identify who created the file and does not scan it for malware. A Base64 data URL copied into another application may be treated as active content there; this tool displays it only as text.

Conversion and hashing run locally without file upload or browser-storage persistence. Page assets and anonymous usage events can still use the network. Copied and downloaded results are independent copies and retain the file's original metadata. The 10 MiB limit is intentional: Base64, binary data and previews otherwise make several simultaneous memory allocations.

Worked example: five binary bytes, including zero and FF

Input
00 ff 10 41 42
Result
AP8QQUI=

Standard padded Base64: five original bytes become eight characters. Decoding recovers all five in the same order.

Common use cases

  • Preparing a small binary attachment for an API that explicitly accepts Base64
  • Creating reproducible test fixtures with exact binary bytes
  • Comparing an original file and decoded copy using SHA-256
  • Generating a data URL without opening or rendering the file

Frequently asked questions

How do I convert a PDF or ZIP to Base64?+

Choose the file and select raw Base64 or a data URL. The converter preserves its bytes rather than interpreting the PDF or ZIP. Download full text saves the complete encoding. The file must be at most 10 MiB.

What is the difference between Base64 and a data URL?+

Raw Base64 is the encoded byte sequence. A data URL adds a prefix such as data:application/pdf;base64, that labels the content. Your receiving application determines which representation it expects.

Why is the encoded result larger than the file?+

Padded Base64 uses four characters for each group of up to three bytes. A data URL also adds its header. Base64 is a transport representation, not compression.

Does URL-safe Base64 encrypt my file?+

No. Standard Base64 and Base64URL are both reversible without a key. URL-safe only changes two alphabet characters; your file's contents and embedded metadata remain recoverable.

Can I verify that decoding did not change the file?+

Compare the original SHA-256 displayed here with the fingerprint shown by Base64 to File. The encoded strings may differ in wrapping, alphabet or padding while representing identical bytes.