Skip to content
Glossary

DeepSeek OCR: How It Works, DeepSeek-OCR 2 and How to Run It

DeepSeek OCR is a free, open-weight model that turns page images into text or Markdown. Here is how DeepSeek-OCR and DeepSeek-OCR 2 work, how they score in 2026, and how to run them.

By Raphaël BalbousDecember 24, 2025 · Updated November 25, 2026 · 9 min read

DeepSeek-OCR
Contents
  1. What is DeepSeek OCR, in one table?
  2. How does DeepSeek-OCR work?
  3. What does “optical compression” actually mean?
  4. What changed in DeepSeek-OCR 2?
  5. How does DeepSeek OCR compare with other open source OCR models?
  6. How do you run DeepSeek OCR?
  7. Where does DeepSeek OCR fall short?
  8. Should you use DeepSeek OCR in production?
  9. Frequently asked questions

DeepSeek OCR is an open-weight vision language model from DeepSeek that reads an image of a page and writes back its text, usually as Markdown with the layout kept. The first version, DeepSeek-OCR, came out on October 20, 2025 under the MIT license; DeepSeek-OCR 2 followed on January 27, 2026 under Apache 2.0. Both are free to download and run on your own GPU. What they will not tell you is whether the page they just transcribed is genuine: that question belongs to document fraud detection, a separate step that looks at the file itself rather than at the words on it.

This guide explains how the two models work, what “optical compression” really means, how they score against other open source OCR models in November 2026, and how to run them. Every figure below comes from primary sources read on November 25, 2026: the DeepSeek-OCR paper (arXiv 2510.18234, October 21, 2025), the DeepSeek-OCR 2 paper (arXiv 2601.20552), the two GitHub repositories, the Hugging Face card of DeepSeek-OCR 2 and the OmniDocBench README. Earlier versions of this article contained comparison figures that no source supported; they have been removed.

What is DeepSeek OCR, in one table?

DeepSeek released two separate models, each with its own repository and paper. They share the same decoder and the same idea, turning a page into a small number of visual tokens, but the second one changes the encoder. The table below sums up what you need before choosing one.

ModelDeepSeek-OCRDeepSeek-OCR 2
ReleaseOct 20, 2025Jan 27, 2026
LicenseMITApache 2.0
EncoderSAM + CLIPSAM + Qwen2 0.5B
Decoder3B MoE3B MoE (same)
Tokens per page64 to 400 (or more in Gundam mode)256 to 1,120
OmniDocBench v1.587.3691.09

The OmniDocBench v1.5 scores are the ones reported in the DeepSeek-OCR 2 paper, with DeepSeek-OCR measured in its 9 crop setting. On the newer v1.6 leaderboard, DeepSeek-OCR 2 scores 90.25 (see below).

How does DeepSeek-OCR work?

The model has two halves. An encoder looks at the page image and turns it into a short sequence of visual tokens. A language model decoder then reads those tokens and writes the text. The whole bet of DeepSeek-OCR is that the first half can be made very frugal without losing the words.

From page image to Markdown

  1. Step 1Page image
    • Scan, photo or PDF page
    • Resized to the chosen mode
  2. Step 2DeepEncoder
    • SAM reads local detail
    • 16x token compressor
  3. Step 3Visual tokens
    • 64 to 400 per page
    • CLIP adds global context
  4. OutputMoE decoder
    • About 570M active parameters
    • Text or Markdown
Sources: DeepSeek-OCR paper (arXiv 2510.18234) and GitHub repository, read on November 25, 2026.

The encoder: DeepEncoder

DeepEncoder chains two well known vision models. A SAM base model (about 80 million parameters) works on small windows of the image and captures fine detail: characters, table lines, the edge of a stamp. A convolutional compressor then divides the number of tokens by 16 before a CLIP large model (about 300 million parameters) applies global attention to what is left. Putting the cheap local stage first and the expensive global stage last is what keeps memory low on high resolution pages.

SAM 2 logo, Meta's computer vision model
OpenAI logo

The decoder: a 3B mixture of experts

The decoder is DeepSeek3B-MoE: about 3 billion parameters in total, of which roughly 570 million are active for each token. A router picks a few specialised sub-networks for each step instead of running the whole model, so the model has the capacity of a 3B network with the running cost of a much smaller one.

Where MLA and FlashMLA fit in

Many explanations of DeepSeek OCR, including an earlier version of this page, describe multi-head latent attention (MLA) and the FlashMLA kernel as part of the OCR model. Both are real DeepSeek technologies: MLA compresses the attention keys and values of a language model into a smaller latent space to save memory on long contexts, and FlashMLA is DeepSeek's open source GPU kernel for it. They were introduced with the DeepSeek-V2 and V3 language models. The DeepSeek-OCR paper cites those models for its decoder but does not present MLA or FlashMLA as part of its contribution, so the gains reported for the OCR model come from the encoder and the token budget, not from them.

GitHub page of DeepSeek's FlashMLA repository, an MLA decoding kernel for Hopper GPUs

The resolution modes

You choose how many visual tokens a page gets, and that choice drives both speed and accuracy: fewer tokens means faster runs but more risk of dropped words. The repository lists five modes, from the cheapest to the most detailed:

  • Tiny: 512 x 512 pixels, 64 tokens.
  • Small: 640 x 640, 100 tokens.
  • Base: 1024 x 1024, 256 tokens.
  • Large: 1280 x 1280, 400 tokens.
  • Gundam: several 640 x 640 tiles plus one 1024 x 1024 global view, for dense pages such as newspapers.

What does “optical compression” actually mean?

It has nothing to do with shrinking the image file. The compression ratio is the number of text tokens on the page divided by the number of visual tokens the model receives. A page that holds 1,000 words of text, read through 100 visual tokens, is compressed about ten times.

The DeepSeek-OCR paper measures this on the English documents of the Fox benchmark, pages holding 600 to 1,300 text tokens. It reports about 97% OCR precision when the ratio stays under 10, and about 60% at a ratio of 20. On OmniDocBench, it beat GOT-OCR 2.0 (256 tokens per page) with only 100 visual tokens, and MinerU 2.0 (more than 6,000 tokens per page on average) with fewer than 800. The authors also report that a single A100 40 GB GPU can produce more than 200,000 pages of training data a day.

OCR performance graphs showing precision and edit distance by model

Two practical lessons follow. First, a dense page read in Tiny or Small mode will lose words: the 97% figure only holds while the page is not squeezed too hard, so dense documents need Large or Gundam. Second, the research goal is wider than OCR. DeepSeek presents optical compression as a way to store long conversation history as images for language models, which explains why so much coverage of the model talks about “AI memory”.

What changed in DeepSeek-OCR 2?

DeepSeek-OCR 2, described in the paper “DeepSeek-OCR 2: Visual Causal Flow” (arXiv 2601.20552, January 28, 2026), keeps the decoder and rebuilds the encoder. CLIP is replaced by a small language model, Qwen2 0.5B, and the encoder gets learnable queries that read the visual tokens in causal order. In plain terms, the encoder learns to rearrange the page into a reading order before the decoder starts writing, instead of scanning it as a fixed grid.

The page is now seen as one global 1024 x 1024 view (256 tokens) plus zero to six local crops of 768 x 768 (144 tokens each), so between 256 and 1,120 visual tokens. The paper reports:

  • an OmniDocBench v1.5 score of 91.09, against 87.36 for DeepSeek-OCR, with a similar token budget (1,120 against 1,156);
  • a reading order edit distance down from 0.085 to 0.057, the clearest gain on multi-column pages;
  • fewer repetition loops, where the model writes the same line again and again: 4.17% of online user images against 6.25%, and 2.88% of PDF pages against 3.69%.

The same paper is frank about the weak spot: newspapers still show a text edit distance above 0.13, which the authors attribute to the token cap and to limited newspaper training data.

How does DeepSeek OCR compare with other open source OCR models?

OmniDocBench is the benchmark most open source OCR projects report on. Its leaderboard moved to version 1.6, and the latest update, on November 23, 2026, added OvisOCR3. Here is where DeepSeek-OCR 2 stands among the models we follow:

ModelOmniDocBench v1.6
OXR-1.097.03
TeleOCR96.91
OvisOCR396.69
PaddleOCR-VL 1.696.34
MinerU 2.5 Pro95.75
GLM-OCR95.22
dots.ocr90.77
DeepSeek-OCR 290.25
olmOCR85.74

DeepSeek-OCR 2 is no longer among the most accurate document parsers: about six points separate it from the leaders. Its case rests on efficiency, a permissive license and a large community (more than 140,000 downloads of DeepSeek-OCR 2 on Hugging Face over the last month). If raw accuracy on complex layouts matters most, our ranking of the open source OCR models compares the leaders on GPU needs, cost and license terms.

How do you run DeepSeek OCR?

Both models need an NVIDIA GPU. DeepSeek does not publish a minimum amount of video memory; the weights of DeepSeek-OCR 2 alone are about 3 billion parameters in BF16, roughly 6 GB, before any working memory. The steps below follow the official DeepSeek-OCR 2 repository.

  1. Prepare the environment the repository was tested on: Python 3.12.9, CUDA 11.8, torch 2.6.0, torchvision 0.21.0 and flash-attn 2.7.3.
  2. For batch work, install the vLLM 0.8.5 wheel and use the provided scripts for images (run_dpsk_ocr2_image.py) or PDFs (run_dpsk_ocr2_pdf.py). DeepSeek-OCR itself has been supported in upstream vLLM since October 23, 2025.
  3. For a quick test, load deepseek-ai/DeepSeek-OCR-2 with Hugging Face Transformers (the card lists version 4.46.3), in bfloat16 with flash attention.
  4. Pick the prompt: <image>\n<|grounding|>Convert the document to markdown. keeps the layout, while <image>\nFree OCR. returns plain text.

Community builds also exist for local tools such as Ollama. They are convenient for trying the model on a laptop, but they are not published by DeepSeek, so check which version and which quantisation you are actually running before you compare results.

Where does DeepSeek OCR fall short?

The papers and the repositories point to the same technical limits, and using the model on real business documents, rather than on benchmark pages, adds a few more that matter before you plug it into a workflow:

  • Dense pages: newspapers and very small print remain the weakest case, even for version 2.
  • Repetition: the model can loop on a line; version 2 reduces it to about 4% of user images, not to zero.
  • No field extraction: the output is text or Markdown. Turning a page into named fields (invoice number, total, IBAN) and checking them is another layer, the job of tools built for invoice OCR and similar documents.
  • No confidence per field: nothing tells you which value to review by hand.
  • No authenticity check: a model that reads perfectly will transcribe an edited total or a pasted logo just as faithfully as the original. Detecting a doctored bank statement takes a fake bank statement detector that inspects the PDF structure, the fonts and the image, not only the text.

Should you use DeepSeek OCR in production?

For a data or ML team that wants to convert large volumes of clean PDFs into Markdown for search or for training a model, yes: the license allows it, the throughput is high, and version 2 fixes the reading order problems of the first release. For a team that needs the most accurate parsing of complex layouts, the models at the top of the leaderboard do better today. For finance, compliance or risk teams that receive documents from customers and suppliers, OCR is only the first step: the values still have to be extracted into fields, compared and checked for tampering.

Frequently asked questions

Does DeepSeek have an OCR model?

Yes, two: DeepSeek-OCR, released on October 20, 2025, and DeepSeek-OCR 2, released on January 27, 2026. Both read a page image and return text or Markdown, and both can be downloaded from GitHub and Hugging Face.

Is DeepSeek OCR free and open source?

Yes. DeepSeek-OCR is published under the MIT license and DeepSeek-OCR 2 under Apache 2.0, with code and weights available. You pay only for the GPU you run it on.

What GPU do you need to run DeepSeek OCR?

An NVIDIA GPU with CUDA. DeepSeek gives no minimum; the official throughput figures were measured on an A100 40 GB, and the BF16 weights of DeepSeek-OCR 2 take about 6 GB before working memory.

Is DeepSeek-OCR 2 better than DeepSeek-OCR?

On the authors' own tests, yes: 91.09 against 87.36 on OmniDocBench v1.5, a better reading order (edit distance 0.057 against 0.085) and fewer repetition loops, for a similar number of visual tokens.

How do you OCR text from an image with DeepSeek?

Load the model with Transformers or vLLM, pass the image with the prompt “Free OCR.” for plain text, or “Convert the document to markdown.” with the grounding tag to keep tables and headings.

Automate your document processing with Koncile

Upload your invoices, statements or purchase orders: Koncile extracts the data, checks it and sends it to your tools, by API or in Excel.

Talk to an expert