DeepSeek-OCR 2: Turn a Document Image into Markdown

DeepSeek-OCR 2: turn a document image into Markdown

DeepSeek-OCR 2 is DeepSeek’s downloadable document-reading model, published as deepseek-ai/DeepSeek-OCR-2. It takes an image of a page and can return text or layout-aware Markdown. For a PDF, the official repository’s PDF workflow first renders its pages as images. It is a different product from asking a question about a PDF in DeepSeek Chat or sending an image to the hosted DeepSeek Vision API.

Browser route to explore it: use a clearly labelled community-operated demo with a fictional or public document, choose Markdown, and check the result against the source page. For private documents or repeatable production work, evaluate the official code and weights in your own reviewed environment. DeepSeek’s published API model table did not list OCR-2 as a selectable model when we checked it on 24 September 2026.

Our observed first result: on one original, clear English page, 11 of 13 checks set before the run passed. The output kept the two-column reading order and numeric values in their table rows, but corrupted the currency symbols in two rows and misspelled a heading. That is a single document observation, not an overall accuracy score. Inspect the image and full output.

By China AI Chat Team. Sources and hands-on observation reviewed 24 September 2026. Editorial revision: 27 September 2026. Research and editorial review were AI-assisted; see our methodology. ChinaAI is independent of DeepSeek and of the community demo operator.

On this page: Choose a route · Try the browser demo · See our result · Check your output · Local setup considerations · Common questions

Choose the right route before uploading a file

Your jobStarting routeWhat it does not establish
Ask questions about a PDF in the official consumer appDeepSeek Chat PDF guideA chat answer does not identify its underlying OCR checkpoint.
Extract text or Markdown from a document image with the named OCR-2 modelTry the community Space with non-sensitive material, or run the official checkpoint locally.The Space is not an official DeepSeek service, and output still needs verification.
Send an image question to DeepSeek’s hosted APIDeepSeek Vision API guideIts published deepseek-flash image input is not proof that OCR-2 weights served the request.

Try a document image in the browser

Privacy and availability: this is third-party hosted software, not DeepSeek’s official chat or API. Do not submit a confidential contract, ID, medical record, unpublished business file or credential to test a public demo. A free GPU queue or changing community service may fail or be unavailable. We have not audited the operator’s retention or access controls.

  1. Open the DeepSeek-OCR-2 community Space. Its application source, inspected for our 24 September test, pointed to deepseek-ai/DeepSeek-OCR-2; the operator, queue, code and weights can change, so inspect its current description before using it.
  2. Upload a fictional or already public image. If you upload a PDF, select the page you want to extract. The Space processes an uploaded PDF one selected page at a time, according to its app source; it is not a complete multi-page conversion in one click.
  3. Choose Markdown and select Extract. In the inspected source, this mode sends the official Markdown prompt shown below, with image-processing settings handled by the Space.
  4. Read the Text and Raw Text views; compare the result with the page. Check every figure and table cell, not just whether the text sounds plausible. A Markdown preview can make a damaged table look tidy.

Our one-page OCR test

We created the fictional “North Pier Field Note” to make an OCR claim checkable. Its two columns have an intended reading order, and its materials table ties item names to quantities, prices and totals. We set 13 checks before the request. This is one deliberately clear English page, not a general accuracy benchmark or a test of handwriting, other languages, low-quality scans or long PDFs.

On 24 September 2026, we sent one request through the community demo’s published API in Markdown mode. We kept the first output, with no repair prompt or rerun. The app source named OCR-2, but its model revision was not pinned; we did not run the model locally.

Fictional North Pier Field Note with two text columns, a materials table, exception and verification code.
Our original fictional test page. Open the image to inspect every word and table cell at full resolution.

What the first output got right and wrong

11 of the 13 checks set before the run passed. The title, record, date, four content sentences, intended section order, grand total, exception and verification code matched this source page. That includes reading the left column before the right column, then the table. This count describes only our single, relatively clean page.

Source imageFirst delivered outputWhy it matters
Beacon cap: $12.00 per unit, $36.00 total\(12.00 and \)36.00The numeric values stayed in the correct row, but the currency markers did not. This predeclared row check failed.
Seal kit: $7.50 per unit, $15.00 total\(7.50 and \)15.00The same corruption made the second row check fail.
HANDOFFHANDFOA separate heading transcription error; headings were not part of the 13 frozen checks.
Grand total $51.00$51.00 in the final table cellThis check passed, but a correct total does not repair the two item rows.

The Space returned an HTML table inside its Markdown text. Its Raw Text result also contained the malformed currency markers. We cannot isolate whether the OCR checkpoint or the community app’s processing introduced them. Verify the delivered text, especially money and tables, against the image before reuse.

Read the complete first Markdown output

This is the first response as text, including the uncorrected heading and escaped currency. The table markup is shown literally so you can compare its cells with the image above.

## North Pier Field Note
Record NP-024 | Revision B | 24 September 2026
## PURPOSE
Three solar beacons need a routine condition check.
## SCOPE
Only the east ramp is included in this note.
## DECISION
Inspect before replacement.
## HANDFO
Send the report to the maintenance desk.
## Materials estimate
<table><tr><td>Item</td><td>Qty</td><td>Unit cost</td><td>Total</td></tr><tr><td>Beacon cap</td><td>3</td><td>\(12.00</td><td>\)36.00</td></tr><tr><td>Seal kit</td><td>2</td><td>\(7.50</td><td>\)15.00</td></tr><tr><td>Grand total</td><td></td><td></td><td>$51.00</td></tr></table>
## EXCEPTION
The west ramp is outside this note.
Verification code: LARCH-42
All names and amounts on this page are invented for an OCR test.
Test conditions, file fingerprint and timing
Test conditionRecorded value
ImageOriginal 1600 × 2100 PNG; fictional content; SHA-256 e5943f00de9e9104d48f4a6d8fbe6220660131c553a7bfd46d99bee33751296e.
Where it ranCommunity-operated merterbak/DeepSeek-OCR-Demo, using its documented Gradio /run endpoint. Its inspected app source named the official OCR-2 checkpoint; the model revision was not pinned.
Mode and underlying prompt📋 Markdown. The inspected Space source maps this mode to <image> followed by <|grounding|>Convert the document to markdown.
RunsOne completed inference, 24 September 2026, 05:09:37–05:09:53 UTC. We used the Space’s published API, with no repair prompt, rerun or local checkpoint test.
Result11 of 13 predeclared checks passed on this page. The two item-row currency checks failed, and one heading was also transcribed incorrectly.

Download the original image, frozen 13-check protocol, complete first Markdown and Raw Text outputs, raw request result, and assessment (ZIP, 97 KB). The ZIP contains a fictional document only. It does not include private user material or API credentials.

How to verify an OCR result that looks convincing

Why reading order matters: the DeepSeek-OCR 2 paper describes a revised visual-token ordering method called Visual Causal Flow, intended to improve how complex pages are read. That is a description of the model’s design, not proof that a particular two-column page was transcribed in the right sequence. The earlier DeepSeek-OCR is a separate release; use the exact OCR-2 checkpoint when reproducing this guide.

  • Text: compare critical names, dates, codes and numbers character by character with the original page.
  • Order: for multi-column layouts, check that sections were not interleaved or silently skipped.
  • Tables: match every value to its row and column. Recalculate arithmetic independently; a correct grand total alone cannot prove that the rows were extracted correctly.
  • Completeness: count document pages, output pages, headings, figures, footnotes and small print. If the output stops early or has repeated fragments, mark the page incomplete.
  • Use: keep the original file beside the extracted text and put a human review step before making the text searchable, feeding it into an answer system, or relying on it for payment, legal or medical decisions.

How the official local route differs

DeepSeek’s official repository documents the checkpoint, a Transformers image example and separate vLLM scripts for images and PDFs. Its published example uses an NVIDIA GPU with CUDA, BF16 and FlashAttention; the README identifies its Python, PyTorch and CUDA environment. Check the current versioned requirements and your hardware before installing. The published example will not run unchanged on a CPU-only machine, and the sources do not give an official minimum GPU-memory figure. We did not run the local code for this guide.

For a document image, the official Markdown prompt contains these two lines:

<image>
<|grounding|>Convert the document to markdown.

For plain text extraction, the repository also documents Free OCR. after the <image> line. Follow the repository’s image example for the Markdown route. Its PDF script renders pages before OCR, so count input and output pages and inspect each result. Loading the model with trust_remote_code=True executes code supplied with the model repository: review and pin the code revision as Hugging Face recommends, and run a first experiment in an isolated environment.

Code-review caution: our static inspection found Python eval() applied to model-produced text in the official vLLM annotation scripts for images and PDFs, and in the community Space’s box-drawing code. This is a review warning, not a demonstrated exploit. Do not treat those unmodified visualization paths as vetted for hostile files; review or replace that parsing before using untrusted input. The separate Transformers image example is the simpler place to begin a reviewed local experiment.

Common questions

Is DeepSeek-OCR 2 available through DeepSeek’s official API?

The published DeepSeek API model table we checked on 24 September 2026 did not list OCR-2. The table does list hosted chat models, and DeepSeek’s Vision guide documents image input for deepseek-flash. Those are separate facts; do not assume a Flash request uses the OCR-2 checkpoint.

Is DeepSeek-OCR 2 free?

DeepSeek’s repository license and model card identify Apache-2.0 for the published model/code. Running it still needs suitable compute and storage, which may cost money. A community demo’s temporary availability or queue is not an official free-service promise.

Can I use a PDF instead of an image?

Yes, through a workflow that turns PDF pages into images. DeepSeek’s official vLLM PDF script renders and processes pages; the inspected community demo lets you choose a single PDF page. Neither is the same as the consumer chat PDF workflow. Verify the page count and reading order in any batch result.

Sources and scope: DeepSeek’s OCR-2 repository, official model card, authors’ paper, DeepSeek API model table, and the community demo source were inspected on 24 September 2026. Recheck the model card, demo source and hosted model list before relying on availability or installation details. For the wider family, see our DeepSeek models map and DeepSeek overview.