How to encode excel files to base64 without python base64.b64encode() or a cli
- Step 1Open the tool instead of a terminal — No shell or Python needed — load the page in any browser.
- Step 2Drop the file — Upload the
.xlsx/.xls/.ods/.csv. The picker is filtered to those extensions. - Step 3Let btoa() run — The bytes are read with
file.arrayBuffer(), built into a binary string in 32 KB chunks, and encoded withbtoa()— the browser analogue ofb64encode(). - Step 4Match the Python output exactly — Delete the two
//lines and the blank separator so what's left is the bare Base64 — identical tob64encode().decode(). - Step 5Copy or download — Copy to clipboard (whole block) or download
name.b64.txt. Strip the header afterwards if you copied. - Step 6Verify equivalence (optional) — Compare against Python:
base64.b64encode(open('f.xlsx','rb').read()).decode()should equal the tool's raw string for the same file.
Python / CLI pattern vs. browser equivalent
What each traditional command does and how the browser tool reproduces it. The Base64 itself is identical; only the surrounding header differs.
| Traditional command | What it returns | Browser tool equivalent |
|---|---|---|
base64.b64encode(data).decode() | Raw Base64 string, no prefix, no comments | Tool output with the three header lines removed |
base64 f.xlsx (coreutils) | Raw Base64, wrapped at 76 cols by default | Tool output (single unwrapped line) — same bytes, no line wrapping |
base64 -w0 f.xlsx | Raw Base64, unwrapped single line | Tool's raw Base64 directly (also unwrapped) |
certutil -encode (Windows) | Base64 with BEGIN/END CERTIFICATE banners | Tool output, cleaner — just // comments you strip |
What the output text contains
b64encode() returns only the equivalent of Line 4+. The // comment lines are extra context this tool adds; remove them to match Python exactly.
| Line | Example content | Keep it for API use? |
|---|---|---|
| Line 1 | // Base64-encoded: report.xlsx (48,213 bytes) | No — strip it |
| Line 2 | // MIME type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | No — but copy the MIME value into your payload |
| Line 3 | (blank separator line) | No — strip it |
| Line 4+ | UEsDBBQABg... (the raw Base64, no data: prefix) | Yes — this is the only part the API needs |
File-size limits by plan (excel family)
For interactive one-offs the browser is fast up to these caps; for scripting many files in a loop, Python remains the better fit.
| Plan | Max source file | Approx. Base64 output (+33%) | Files per run |
|---|---|---|---|
| Free | 5 MB | ~6.7 MB | 1 |
| Pro | 50 MB | ~66.5 MB | 5 |
| Pro-media | 200 MB | ~266 MB | 20 |
| Developer | 500 MB | ~665 MB | unlimited |
Cookbook
Each recipe pairs a familiar command with the browser equivalent and shows that the resulting Base64 is the same.
The classic one-liner, in the browser
Drop the file, strip the header — same string the Python one-liner prints.
# Python:
python3 -c "import base64; print(base64.b64encode(open('data.xlsx','rb').read()).decode())"
-> UEsDBBQABg...
# Browser tool output:
// Base64-encoded: data.xlsx (12,044 bytes)
// MIME type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
UEsDBBQABg... <- identical after removing the // headerProve the outputs are equal
Save the tool's raw string and diff it against the Python output — they match byte for byte.
tail -n +4 data.xlsx.b64.txt > browser.b64
python3 -c "import base64;print(base64.b64encode(open('data.xlsx','rb').read()).decode())" > python.b64
diff browser.b64 python.b64
# (no output = identical)macOS/Linux base64 wraps lines; the tool doesn't
coreutils base64 wraps at 76 columns by default. The tool emits one unwrapped line, equivalent to base64 -w0.
base64 data.xlsx # wrapped at 76 cols base64 -w0 data.xlsx # single line <- matches the tool's raw output
Get the byte count Python's b64encode() omits
A bare b64encode() tells you nothing about size. The tool's header line gives it for free.
// Base64-encoded: data.xlsx (12,044 bytes)
^^^^^^ source size, no extra command neededBuild a data URI by hand (Python doesn't either)
Neither b64encode() nor this tool adds a data URI. Use the printed MIME to construct one when a browser embed needs it.
// MIME type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,UEsDBBQABg...
Edge cases and what actually happens
Output not matching b64encode() exactly
Header not strippedIf a diff shows extra leading lines, you kept the // comments. Remove the first three lines (tail -n +4) to match b64encode().decode().
coreutils base64 looks different (line breaks)
Expectedbase64 wraps at 76 columns by default; the tool emits one unwrapped line. Strip newlines from the CLI output (or use -w0) and they're identical.
Batch-encoding hundreds of files
Use a scriptThe browser handles one file at a time on the Free tier (one file per run). For bulk encoding, a Python loop is more efficient — the tool is best for interactive one-offs.
File larger than the plan cap
RejectedFree 5 MB, Pro 50 MB, Pro-media 200 MB, Developer 500 MB. Python has no such cap (only RAM), so very large files may be a job for the CLI.
Expecting a data: URI like some encoders add
By designNeither Python's b64encode() nor this tool prepends a data: prefix. Build the URI yourself from the printed MIME if you need it.
Encoding a .csv as bytes
SupportedIdentical to base64 data.csv: the raw file bytes are encoded; MIME line reads text/csv.
Very large string slow in the preview
ExpectedRendering 10+ MB of Base64 on-screen can lag even though encoding is fast. Use Download instead of reading it inline.
.xlsm or .pdf you'd encode with base64 in a shell
Not selectableThe picker is limited to spreadsheet extensions. For other file types the shell base64 command or a general encoder is the right tool.
Need code generation, not a blob
Use sibling toolIf the goal is to turn the sheet into Python data structures, use the Python Dict/List Generator rather than Base64-encoding the file.
Frequently asked questions
Is the output identical to Python's base64.b64encode()?
Yes for the Base64 itself — standard Base64 is deterministic. The only difference is the two // comment lines this tool adds; remove them to match exactly.
How do I make it match b64encode().decode() exactly?
Delete the first three output lines (the two // comments and the blank line). The remaining single line equals b64encode().decode().
Why does macOS `base64` output look different?
coreutils base64 wraps at 76 columns by default; this tool emits one unwrapped line (like base64 -w0). Strip the wrapping newlines and they're identical.
Does the tool wrap lines at 76 columns?
No — it outputs a single unwrapped Base64 line, which is what most APIs want.
Do I need Python or a terminal installed?
No. The tool runs in any browser; encoding is fully client-side via file.arrayBuffer() and btoa().
Is the browser fast enough vs. Python?
For interactive single-file encoding up to the plan cap, yes — chunked btoa() is quick. For batch-encoding many files, a Python loop is more efficient.
What about the data URI prefix?
Neither b64encode() nor this tool adds one. Construct data:<mime>;base64,... yourself from the printed MIME if a browser embed needs it.
Which file types can I encode here?
.xlsx, .xls, .ods, .csv. Other types aren't selectable; use the shell base64 for those.
What's the file-size limit?
Free 5 MB, Pro 50 MB, Pro-media 200 MB, Developer 500 MB on the source file. Python is limited only by available memory.
Does it handle large files without crashing?
Yes — it builds the binary string in 32 KB chunks before btoa(), avoiding the call-stack overflow that naive String.fromCharCode.apply would cause.
Can I decode Base64 back to a file here?
Not yet. Decoding is on the roadmap; use atob() or a decoder for now.
What other dev-bridge Excel tools exist?
See the Python Dict/List Generator, tRPC Router Builder, and SVG Data Viz.
Privacy first
Every JAD Excel tool runs entirely in your browser using SheetJS and ExcelJS. Your spreadsheets, formulas, and data never leave your device — verified by zero outbound network requests during processing.