XLSB to WebP API
Call POST /v2/convert/xlsb/to/webp with an .xlsb file to get a lossless WebP for each printed page. The sample sends ActiveWorksheetOnly=true and receives only its Daily sheet, the tab that was open when the file was saved.
- Endpoint
- POST /v2/
convert/ xlsb/ to/ webp - Accepts
- xlsb
- Sample timing
- 0.751 s median of 5 runsHow we measure
- Request size
- Up to 10 MB on the Free plan or 100 MB on paid plans, all files together
Request and response
Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.
curl -sS -X POST \
https://api.pdfconversionapi.com/v2/convert/xlsb/to/webp \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@meter-readings.xlsb \
--form-string ActiveWorksheetOnly=true \
-o response.json
# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
mkdir -p converted
name=$(jq -r '.Files[0].FileName' response.json)
jq -r '.Files[0].FileData' response.json \
| base64 --decode > "converted/$name"
else
cat response.json
fiimport base64
import os
import requests
key = os.environ["PDFCONVERSIONAPI_KEY"]
response = requests.post(
"https://api.pdfconversionapi.com/v2/convert/xlsb/to/webp",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("meter-readings.xlsb", "rb"))],
data={
"ActiveWorksheetOnly": "true",
},
timeout=180,
)
result = response.json()
if not response.ok:
raise SystemExit(f"{result['Code']}: {result['Message']}")
os.makedirs("converted", exist_ok=True)
for file in result["Files"]:
path = os.path.join("converted", file["FileName"])
with open(path, "wb") as out:
out.write(base64.b64decode(file["FileData"]))
print(path, file["FileSize"], "bytes")
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
const form = new FormData();
const file = "meter-readings.xlsb";
form.append("File", new Blob([await readFile(file)]), file);
form.append("ActiveWorksheetOnly", "true");
const url = "https://api.pdfconversionapi.com/v2/convert/xlsb/to/webp";
const key = process.env.PDFCONVERSIONAPI_KEY;
const response = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${key}` },
body: form,
});
const result = await response.json();
if (!response.ok) {
throw new Error(`${result.Code}: ${result.Message}`);
}
await mkdir("converted", { recursive: true });
for (const file of result.Files) {
const path = join("converted", file.FileName);
await writeFile(path, Buffer.from(file.FileData, "base64"));
console.log(path, file.FileSize, "bytes");
}
{
"ConversionCost": 1,
"ConversionTime": 0.751,
"Files": [
{
"FileName": "meter-readings-1.webp",
"FileExt": "webp",
"FileSize": 19846,
"FileData": "UklGRn5NAABXRUJQVlA4THFN…"
}
]
}Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.
The sample, converted
The same file the code sends. Download the input and the output and compare them yourself.

- Input
- meter-readings.xlsb (3.3 KB)
- Output
- meter-readings-1.webp (19 KB)
- Source
- A fictional cold-storage unit's meter readings in Excel binary format (two sheets with dates, times and formulas) that we wrote record by record for this site (CC0-1.0). How it was made
- Made by
- 2026-11-04, API build
9eeeb0640aba
Parameters
Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.
| Parameter | What it does |
|---|---|
ActiveWorksheetOnlyboolean, default false | Print only the sheet that was selected when the workbook was saved. The sample's Daily tab comes back as one 1,240 × 1,753 WebP of 19,846 bytes instead of two pages. |
ImageWidthinteger | Draw each page at this many pixels wide, height in proportion: 600 gave 600 × 849 and 7,366 bytes for the Daily page.Values: 1–20000 |
ImageResolutioninteger, default 150 | Pixels per inch when no size is given; not recorded in the WebP file.Values: 36–600 |
PageSizeenum, default default | Paper size for the printed sheets. The sample has no page setup and prints on A4; letter gives 1,275 × 1,650 at 150 DPI.Values: default, letter, legal, a3, a4, a5 and others |
WorksheetNamestring | Print a sheet by its name instead of by which one was open. |
FitToPageboolean, default false | Fit each printed sheet to one page wide. The sample's narrow sheets already fit, so it changes nothing there. |
Passwordstring | Open password of an encrypted workbook. |
What carries over, and what doesn't
Kept
- The open sheet recorded in the binary file: Daily, the second tab, is the one printed
- Every pixel of the page, since the WebP is lossless
- Dates, two-decimal values and the bold Average row (96.86) as formatted in the workbook
Lost or not yet supported
- Lossy compression:
ImageQualityhas no effect, and for XLSB it is silently ignored rather than refused (the output bytes are identical withImageQuality=10). - DPI and paper size: the WebP files carry neither.
- Gridlines, and Letter paper when the file stores no page setup: the sample's pages are A4.
Limits
- 2,000 pages per request and 16,000 pixels per side or 100 million pixels per page;
ImageWidthandImageHeightaccept up to 20,000. - Requests up to 10 MB on the Free plan or 100 MB on paid plans; 120 seconds per conversion, then 504.
Where teams use it
Showing the tab a colleague was looking at
When a workbook is saved on the sheet its author wants people to see, ActiveWorksheetOnly=true turns exactly that sheet into a picture for a web page or a message.
Lightweight page images for dashboards
Lossless WebP keeps numbers crisp at a fraction of PNG's size: the sample's Daily page is 19,846 bytes as WebP and 93,315 bytes as PNG.
Questions
How does the API know which sheet was open?
XLSB files record the selected tab in their workbook view settings. When you send ActiveWorksheetOnly=true, that tab is printed and the others are hidden for the conversion. Without it, every visible sheet is printed.
Can I make the WebP smaller with a quality setting?
Not on this route: pages are always lossless and ImageQuality makes no difference. Lower ImageResolution or set ImageWidth, or use /v2/convert/xlsb/to/jpg for lossy output.
Does the same option work for XLSB to JSON?
Yes. xlsb/to/json and xlsb/to/csv read the same open tab with ActiveWorksheetOnly=true: for the sample they return the Daily rows, 602 bytes of JSON, instead of the first sheet, Readings.
Convert your first XLSB file in a minute.