MOBI to JPG API
POST a .mobi file to /v2/convert/mobi/to/jpg and get a JPEG of every page. At ImageResolution=90 and ImageQuality=80 the six-page sample became six 765 × 990 JPEGs, 366,055 bytes in all, from 24,854 bytes for the contents page to 94,834 for chapter 1.
- Endpoint
- POST /v2/
convert/ mobi/ to/ jpg - Accepts
- mobi
- Sample timing
- 91 ms 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/mobi/to/jpg \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@cape-merrow-light.mobi \
--form-string ImageResolution=90 \
--form-string ImageQuality=80 \
-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/mobi/to/jpg",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("cape-merrow-light.mobi", "rb"))],
data={
"ImageResolution": "90",
"ImageQuality": "80",
},
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 = "cape-merrow-light.mobi";
form.append("File", new Blob([await readFile(file)]), file);
form.append("ImageResolution", "90");
form.append("ImageQuality", "80");
const url = "https://api.pdfconversionapi.com/v2/convert/mobi/to/jpg";
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.091,
"Files": [
{
"FileName": "cape-merrow-light-1.jpg",
"FileExt": "jpg",
"FileSize": 40780,
"FileData": "/9j/4AAQSkZJRgABAgEAWgBa…"
},
{
"FileName": "cape-merrow-light-2.jpg",
"FileExt": "jpg",
"FileSize": 24854,
"FileData": "/9j/4AAQSkZJRgABAgEAWgBa…"
},
{
"FileName": "cape-merrow-light-3.jpg",
"FileExt": "jpg",
"FileSize": 94834,
"FileData": "/9j/4AAQSkZJRgABAgEAWgBa…"
},
… 3 more files
]
}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
- cape-merrow-light.mobi (29 KB)
- Output
- cape-merrow-light-1.jpg (40 KB)cape-merrow-light-2.jpg (24 KB)cape-merrow-light-3.jpg (93 KB)cape-merrow-light-4.jpg (84 KB)cape-merrow-light-5.jpg (85 KB)cape-merrow-light-6.jpg (32 KB)
- Source
- A short fictional e-book about a lighthouse keeper's year, with a cover, a map and a chart, written and drawn by us and packed as a MOBI file by our own script. (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 |
|---|---|
ImageQualityinteger, default 85 | JPEG quality. ConvertAPI documents 75; we use 85 when it is not sent. With no options at all the sample's six pages total 927,873 bytes.Values: 1–100 |
ImageResolutioninteger, default 150 | Resolution the Letter pages are drawn at: 90 gives 765 × 990, 150 gives 1275 × 1650. When sent, it is written to the JFIF header too.Values: 36–600 |
ImageWidthinteger | Fixed pixel width for every page.Values: 1–20,000 |
ImageHeightinteger | Fixed pixel height for every page.Values: 1–20,000 |
PageRangestring | Only some pages, for example 3 for the first chapter of the sample.Values: 1, 3-5, 4-, 2-last |
PageSizeenum, default letter | Paper size for the layout; e-book pages are always portrait.Values: a0–a9, b0–b5, letter, legal, ledger |
BaseFontSizenumber, default 12 | Base text size. Because MOBI text carries no CSS, this sets body text and, in proportion, the headings.Values: 1–50 (points) |
MarginTopnumber, default 40 | Top margin in points.Values: 0–200 (points) |
MarginRightnumber, default 40 | Right margin in points.Values: 0–200 (points) |
MarginBottomnumber, default 40 | Bottom margin in points.Values: 0–200 (points) |
MarginLeftnumber, default 40 | Left margin in points.Values: 0–200 (points) |
ColorSpaceenum, default default | Grayscale or black-and-white JPEGs with one channel.Values: default, rgb, gray, monochrome |
BackgroundColorstring, default white | Page color under the text.Values: Color names, #RRGGBB or R,G,B |
FileNamestring | Base name; files are numbered -1.jpg onward. |
StoreFileboolean, default false | Download links for 3 hours instead of base64 JPEGs. |
What carries over, and what doesn't
Kept
- Every page in the book's order: cover and title, contents, the three chapters and the colophon
- The JPEG cover, the PNG map and the GIF bar chart from the book's image records, each on its page
- Bold, italic, chapter headings, the indented logbook quote and the bulleted repair list
- The UTF-8 text's curly quotes and apostrophes
- Color detail: the JPEGs are encoded without chroma subsampling
Lost or not yet supported
- MOBI 6 layout attributes, as on every route: centering, font sizes, paragraph indents and table borders are not drawn, so the lamp-hours table in chapter 2 has no rules and its numbers are not right-aligned.
- A cover that lives only in the MOBI header, which is never drawn.
- Exact pixels: JPEG is lossy. Use
mobi/to/pngwhen you need lossless pages. - The book's title and author metadata, which is not written into the JPEG files.
- Clickable contents entries; the filepos links become plain text.
Limits
- One book per request; two files return 400.
- Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
- Up to 2,000 pages, and so 2,000 JPEGs, per request.
- DRM-protected books return 422; books compressed with HUFF/CDIC return 404.
- Files that are not MOBI books return 422 "this is not a MOBI book".
- 120 seconds per conversion.
Where teams use it
Page previews for a MOBI back catalog
A shop or library that still lists MOBI titles can show a few page images per book. At 90 dpi and quality 80 a full page of the sample's text is under 100 KB.
Pages for slides, posts and print-on-demand proofs
Pull a single page with PageRange and drop the JPEG into a presentation, a social post or a proof sheet. The page carries the book's pictures as well as its text.
Questions
How many files will I get?
One JPEG per page after layout. MOBI page breaks (<mbp:pagebreak/>) always start a new page, so the sample has six on Letter even though some sections are short; on A6 it has 13.
Which picture formats inside the book are drawn?
JPEG, PNG, GIF and BMP image records referenced from the text with recindex. The sample's JPEG cover, PNG map and GIF chart all appear. Records in other formats are left out of the page.
Can I convert books I bought for my Kindle?
Not if they are DRM-protected: the API answers 422 "the book is DRM-protected". Unprotected MOBI files, such as ones you made yourself or got without DRM, convert.
Why is the text not centered like on my Kindle?
MOBI 6 books set centering and sizes with HTML attributes like align="center" and font size, which our layout ignores; it applies CSS, which these books do not have. The sample's title page is therefore left-aligned in the JPEG.
Convert your first MOBI file in a minute.