OCRZero

Guide · PDF to Markdown

Convert a PDF to Markdown with Xiaomi-OCR-0

Xiaomi-OCR-0 reads one page image at a time, so a PDF is first rendered to images, then every page is parsed to Markdown and the pages are joined in order. OCRZero follows the official pipeline for each step.

Convert a PDF to Markdown

In short

  • Each PDF page is rendered at 150 dpi, capped at 2,200 pixels wide, as in the official pipeline.
  • Tables come back as HTML inside the Markdown; formulas come back as LaTeX.
  • OCRZero processes up to 20 pages per request and bills 1 credit per page.
  • Pages that fail or return truncated or repetitive output are refunded.

How the PDF pipeline works

OCRZero runs four steps for every PDF.

  1. Render. Each page is drawn to an image at 150 dpi; wide pages are scaled down to 2,200 pixels.
  2. Parse. Xiaomi-OCR-0 turns every page image into Markdown in reading order, ignoring headers and footers.
  3. Clean up. The official postprocess converts OTSL tables to HTML, normalises math delimiters and trims runaway repetition.
  4. Join. Pages are joined in order, each marked with an HTML comment such as page 3.

Tables, formulas and layout

The model writes tables in OTSL, a compact table markup with merged cells. OCRZero converts them to HTML tables with rowspan and colspan, which most Markdown renderers and RAG pipelines accept.

Formulas are written in LaTeX, inline as $ … $ and display as $$ … $$. Figures are not described; Xiaomi-OCR-0 extracts the text content of the page.

Speed and cost

In our tests on a text-heavy research paper, a page took about 5 to 15 seconds on a single stream, depending on how much text it held. On OCRZero every page costs 1 credit: $5 per 1,000 pages, with 20 free pages for new eligible accounts.

Frequently asked questions

How many pages can I convert at once?

Up to 20 pages and 25 MB per request. Split longer PDFs into several requests; each request returns its own Markdown.

Does it work on scanned PDFs?

Yes. Pages are rendered to images first, so scanned and digital PDFs are read the same way.

Are password-protected PDFs supported?

No. Remove the password before uploading.

Sources

Updated 2026-10-31. OCRZero is an independent service running the open-source Xiaomi-OCR-0 model (Apache-2.0, by Xiaomi). Not affiliated with or endorsed by Xiaomi.