How LLMs Are Revolutionizing OCR-Based Document Analysis
Published December 02, 2025

Image generated by Google Gemini
Introduction
OCR (Optical Character Recognition) refers to a specific process for digitizing text. The name comes from the fact that the computer recognizes characters based on their visual form (Optical) and combines them into a string one by one (Character).
This process underpins most open and commercial software solutions for text digitization. To the frustration of many developers and users, this approach repeatedly leads to problems: an imperfect scan, an unusual font or a poor handwriting and the results deteriorate.
If you want to read more than plain running text, a non-trivial development effort is required so that the text is ingested according to layout or data structure. Another source of frustration is that every character is processed independently of its context. For every human reader it is obvious which character is missing here:
but not for an OCR engine.
If a character is written unclearly it will not be correctly recognized no matter in which context it appears. Exactly this context-aware processing has become possible for computers since the development of LLMs.
Modern LLMs can also process far more than just text: so-called multimodal models interpret multiple modalities simultaneously.
These circumstances have enabled models specifically developed and trained for text digitization. These models no longer share the shortcomings of classical OCR engines, as we will see below.
For our comparison we contrast two approaches:
- The "classical" pipeline: We use Tesseract combined with the essential preprocessing steps (via OpenCV) required for clean text recognition – primarily converting to a clear black-and-white image (binarization).
- The "modern" pipeline: We use the multimodal model dots.ocr that we deployed on one of our servers (A tutorial for this will follow in our next blog post).
For both methods the raw results are not post-processed to allow an unbiased comparison. The exact implementations are available for inspection on our GitHub.
Historical Data

Damaged Documents
One of the biggest challenges for historians are aged documents that often do not even exist in the original anymore to avoid further damage. It is therefore common for historians to work with non-optimal photographs of poorly preserved documents. The example we use here is well preserved, but the age of the document is clearly visible.

Classical Pipeline (Tesseract)
Gi ET In
DOKUMENT? NO" I
In Vereinstimmung mit den Beschlüssen ihrer Regierungen autorisierei
Kilitär-Gowverneure der Amerikanischen, Britischen und Franzöei-
schen Besatzungszone in Deutschland Ale Minister-Präsidenten der Län-
dcr ihrer Zonen, &ine Verfanzunggebende Versammlung einzuberufen, die
spätestens am 1. September 1948 zusam ich sollte. Me Abgsora-
oten zu AMaser Vorsannlung worden in jeden der bostehenden Tänder
Hich”den Verfahren und Richtlinien ausgewählt, Ale durch äle gosetz-
gobende Körperschaft in jeden dieser Länder angenommen werden. Die
Gesamtzahl der Abgeoräneten zur Verfussunggebenden Versammlung wird
bestimut, inden die Gesamtzahl dev Bevölkerung nach der letzten Volte
Zählung dureh T50 000 oder eine ähnliche von den Minister-Präsiäsnten
vorgeschlagene und von den Militär-Gouverneuren gebilligte Zahl ge-
teilt wird, Die Anzahl der Abgeordneten von jedem Lend wird im sel-
den Verhältnis zur Gesamtzahl der Mitglieder der Verfassunggehonden
Versammlung stehen, wie seine Bevölkerung zur Gosamiber Bevölkerung der ı
beteiligten Länder,
Die Verfassunggebende Versammlung wird eine demokratische Verfassung
ausarbeiten, &lo für die beteiligten Bänder eine Regierungsfom des
fö=ieralistischen Typs schafft, die am besten geeignet ä
kenwärtig zerrishe deutsche Einheit schliesslich wieder heraustel-
In, und die Rechte dor beteiligten Länder schützt, eine angenesse-
ne Zemtral-Inptauz schafft, und Garantien der individuellen Rechte
und Freiheiten enthält.
Wenn die Verfassung in dor von der Vorfassunggebenden Versamulung
ausgearbeiteten Form mit diesen allgemelnen Grundsätzen nicht in Wi-
Aszopzuch steht, werden die Mil1tär-Gourerneure ihre Vorlage zur
Batifielorung genehmigen, Die Verfassunggebende Versammlung wird
deraufutn aufgelöst. Die Natitisierung in Jedem beteiligten land
erfolgt durch ein Referanäun, das eins enifache liehrneit der Abstin-
menden in jedem Land erfordert; nach von jedem Land jeweils anzunch-
menden Regeln und Verfahren. Sobald die Verfassung von zuei Dritteln
der Länder ratifiztert Sat, tritt sie in Eraft und ist Tir alle Län-
der bindend, Teda Abänderung der Verfassung muB künftig von einer
Bleichen Mehrheit der Länder rattfiniert werden. Innerhalb von 30
Tagen nach dem Iniwertiweten der Verfassung sollen die darin vor-
geschenen Einrichtungen geschaffen sein.
Modern Pipeline (dots.ocr)
Frankfurt am Main
# DOKUMENT NO I
In Übereinstimmung mit den Beschlüssen ihrer Regierungen autorisierten
die Militär-Gouverneure der Amerikanischen, Britischen und Französi-
schen Besatzungszone in Deutschland die Minister-Präsidenten der Läu-
der ihrer Zonen, eine Verfassunggebende Versammlung einzuberufen, die
spätestens am 1. September 1948 zusammentreten sollte. Die Abgeord-
deten zu dieser Versammlung werden in jedem der bestehenden Länder
nach den Verfahren und Richtlinien ausgewählt, die durch die gesetz-
gebende Körperschaft in jedem dieser Länder angenommen werden. Die
Gesamtzahl der Abgeordneten zur Verfassunggebenden Versammlung wird
bestimmt, indem die Gesamtzahl der Bevölkerung nach der letzten Volks-
zählung durch 750 000 oder eine ähnliche von den Minister-Präsidenten
vorgeschlagene und von den Militär-Gouverneuren gebilligte Zahl ge-
tzeilt wird. Die Anzahl der Abgeordneten von jedem Land wird im sel-
ben Verhältnis zur Gesamtzahl der Mitglieder der Verfassunggebenden
Versammlung stehen, wie seine Bevölkerung zur Gesamtbevölkerung der
beteiligten Länder.
Die Verfassunggebende Versammlung wird eine demokratische Verfassung
ausarbeiten, die für die beteiligten Länder eine Regierungsform des
fülleralistischen Typs schafft, die am besten geeignet ist, die ge-
genwärtig zerrissne deutsche Einheit schliesslich wieder herzustel-
len, und die Rechte der beteiligten Länder schützt, eine angemesse-
ne Zentral-Instanz schafft, und Garantien der individuellen Rechte
und Freiheiten enthält.
Wenn die Verfassung in der von der Verfassunggebenden Versammlung
ausgearbeiteten Form mit diesen allgemeinen Grundsätzen nicht in Wi-
derspruch steht, werden die Militär-Gouverneure ihre Vorlage zur
Ratifizierung genehmigen. Die Verfassunggebende Versammlung wird
daraufhin aufgelöst. Die Ratifizierung in jedem beteiligten Land
erfolgt durch ein Referendum, das eine einfache Mehrheit der Abstim-
menden in jedem Land erfordert, nach von jedem Land jeweils anzuneh-
menden Regeln und Verfahren. Sobald die Verfassung von zwei Dritteln
der Länder ratifiziert ist, tritt sie in Kraft und ist für alle Läu-
der bindend. Jede Abänderung der Verfassung muß künftig von einer
gleichen Mehrheit der Länder ratifiziert werden. Innerhalb von 30
Tagen nach dem Inkrafttreten der Verfassung sollen die darin vor-
gegebenen Einrichtungen geschaffen sein.
In this example the difference between the classical and the modern pipeline is relatively small, but it is already visible that the LLM does not make the errors we find in classical OCR. For instance the classical OCR output contains sequences like Gi ET In, DOKUMENT? NO" I or &ine Verfanzunggebende, while dots.ocr correctly recognizes Frankfurt am Main, # DOKUMENT NO I and eine Verfassunggebende. Despite the document's age the scan is of good quality. If we now rotate the document a few degrees to simulate a worse scan, the result changes drastically.

The classical pipeline is no longer able to recognize the text here and produces an empty file. The modern pipeline still produces a result which has deteriorated somewhat compared to the clean scan, but the manual post-processing required for this file does not compare to the effort of adapting the classical pipeline so that it can handle skewed scans.
Commercial Data & Administrative Processes

In both commercial contexts and public administration structure is often just as important as content itself. In the context of an Excel spreadsheet, for example, meaning lies not only in the text but also in the arrangement of data in rows and columns. In a milder form this is also true of forms such as applications. There are specialized OCR engines for these circumstances that significantly reduce the workload required to build a pipeline tailored to a specific table format or form. Nevertheless the workload is not trivial. Our modern solution does not have to be adapted to produce output of sufficient quality to be further processed elsewhere. Below we show an example invoice.

Klassische Pipeline (Tesseract)
Musterfirma GmbH
Musterfirma GmbH - Musterstraße 12 — 12345 Musterstadt
Max Mustermann
Musterweg 3
11111 Musterhausen
Deutschland
Rechnung
Rechnungsdatum: 11.05.2017
Lieferdatum/Leistungsdatum: 11.05.2017
Ihre Ansprechperson: Max Mustermann
E-Mail: max.mustermann@example.com
Telefon: 030 1234 5678 12
Rechnungsnummer: 1 Kundennummer: 12345 Datum: 15.11.2025
Sehr geehrter Herr Mustermann,
vielen Dank für Ihr Vertrauen in die Musterfirma GmbH. Hiermit stellen wir Ihnen folgende Leistungen in
Rechnung:
Bezeichnung
Produkt A
Produkt B
Produkt C
Nettobetrag
zzgl. Umsatzsteuer 19%
Rechnungsbetrag
275,00 €
52,25€
327,25 €
Der Gesamtbetrag ist bis zum 25.12.2025 mit dem Verwendungszweck 1 auf unser unten genanntes
Konto zu zahlen.
Mit freundlichen Grüßen
Musterfirma GmbH
Musterfirma GmbH Bank: Muster Bank Tel.: 030 1234 5678
Musterstraße 12 IBAN: DE19 1234 1234 1234 1234 12 Fax: 030 1234 5679
12345 Musterstadt BIC: ABCDEFGH E-Mail: info@example.com
Deutschland USt.-IdNr.: DE123456789 Website: www.example.com
Moderne Pipeline (dots.ocr)
Musterfirma GmbH
Musterfirma GmbH – Musterstraße 12 – 12345 Musterstadt
Max Mustermann
Musterweg 3
11111 Musterhausen
Deutschland
Rechnungsdatum: 11.05.2017
Lieferdatum/Leistungsdatum: 11.05.2017
Ihre Ansprechperson: Max Mustermann
E-Mail: max.mustermann@example.com
Telefon: 030 1234 5678 12
Rechnung
Rechnungsnummer: 1
Kundennummer: 12345
Datum: 15.11.2025
Sehr geehrter Herr Mustermann,
vielen Dank für Ihr Vertrauen in die Musterfirma GmbH. Hiermit stellen wir Ihnen folgende Leistungen in Rechnung:
<table><thead><tr><th>Pos.</th><th>Bezeichnung</th><th>Menge</th><th>Einheit</th><th>Einzelpreis</th><th>Gesamtpreis</th></tr></thead><tbody><tr><td>1.</td><td>Produkt A</td><td>15</td><td>Stück</td><td>10,00 €</td><td>150,00 €</td></tr><tr><td>2.</td><td>Produkt B</td><td>10</td><td>Stück</td><td>5,00 €</td><td>50,00 €</td></tr><tr><td>3.</td><td>Produkt C</td><td>3</td><td>Stück</td><td>25,00 €</td><td>75,00 €</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>
Nettobetrag 275,00 €
zzgl. Umsatzsteuer 19% 52,25 €
Rechnungsbetrag 327,25 €
Der Gesamtbetrag ist bis zum 25.12.2025 mit dem Verwendungszweck 1 auf unser unten genanntes Konto zu zahlen.
Mit freundlichen Grüßen
Musterfirma GmbH
The structure of the data is almost completely lost in the classical solution. A human can still guess how it might have been laid out in the original file, but for a computer it is only processable with significant programming effort – especially considering that invoice layouts vary from invoice to invoice. The result of the modern pipeline is harder to read for a human, but it fully retains structure by using HTML elements. This makes further processing downstream far easier.
Handwritten Notes
Handwritten notes are one of the biggest challenges for OCR systems. The variability of handwriting is enormous and sometimes difficult to decipher even for humans. Classical OCR engines quickly reach their limits here. Modern LLM-based systems, however, can often achieve significantly better results due to their training on diverse datasets.

Klassische Pipeline (Tesseract)
uw ug Vet vn abe hlAltst N 100.
anne m bannen une 1.0 Sun nina tn Arno act ser um.
} .
|
=r
an arme
\
|
u -————-
I _ = > Re > [a ,b) Fr > as Zu I
nn
Eu
RL
Ä
j
Bern
I 7,110 ıN
Moderne Pipeline (dots.ocr)
Definition
Das Vektorjeder oder kveeur produkt
zweier Vektoren a, b ∈ ℝ³ ist
eine Abbildung
$\mathbb{R}^3 \times \mathbb{R}^3 \to (a, b) \mapsto axb,$
die für $a = (\alpha_1, \alpha_2, \alpha_3)^T$ und
$b = (\beta_1, \beta_2, \beta_3)^T$ definiert ist
durch:
$$axb = \begin{pmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \end{pmatrix} \times \begin{pmatrix} \beta_1 \\ \beta_2 \\ \beta_3 \end{pmatrix} := \begin{pmatrix} \alpha_2 \beta_3 & -\alpha_3 \beta_2 \\ \alpha_3 \beta_1 & -\alpha_1 \beta_3 \\ \alpha_1 \beta_2 & -\alpha_2 \beta_1 \end{pmatrix}$$
Where classical OCR already fails at the clean separation of symbols and treats semantic symbols like the cross product as a simple "x", the modern model can often reconstruct structure and meaning. If recognition accuracy is not sufficient for a specific use case, an open-source model can of course be fine-tuned on that special scenario.
In the handwritten example the advantage becomes particularly clear: where classical recognition already fails at the neat separation of symbols and treats semantic signs like the cross product only as a simple "x", the modern model reliably reconstructs structure and meaning. Mathematical operators, spacing and logical segmentation are preserved – exactly the difference that drastically reduces manual rework.
Technical Data

A frequently occurring challenge is to archive technical drawings in a meaningful digitized way. Extracting the data on the drawing holds enormous potential for time savings as well as useful database structures. However, all weaknesses of classical OCR collide here: text appears in different orientations, metadata appears in tabular form and position matters. In addition there are sometimes unusual fonts and aging paper. As an example consider this drawing of a water wheel:

https://berlin.museum-digital.de/singleimage?imagenr=8978
Classical Pipeline (Tesseract)
1200
u.
Bert)
ar
- 3500
i
4
un 2 De
(4 3 - - TI. .
‘ syn << 1 N —_ m
RSS Pa |
Fe > ! N!
& Pa i 1 ı ' L
urn 2% | \
33 g8 BR 1 \
sr“ Pa \ N ,
« N
\ Ri \ \ |ı
- Pa \ \ 5 | N I
Y \ ' \
4
1
2] ]
Mech I m. 4100.
mod
yalım Doryaymays ik?
fin Hann Dovkmamn Ihm.
Dorn
E22
>
22 _
NL,
j j
Modern Pipeline (dots.ocr)
Wasserdampf System - Empfänger mit Klappenschlüsseln,
für den Markmann / Lüben.
Markmann 1:10 w. 1:100.
Schritt a-b
R 69
99000 X 10 A VI
As predicted the classical pipeline delivers no usable result here. The modern variant however recognizes what can be extracted as text and returns something useful.
Further Processing

Even more important than just reading data is how we process it. Beyond the advantages that language models provide in OCR there are further opportunities later in the pipeline to get the most out of digitized data. Not only can they be stored as entire plain text, but with little effort they can be searched for specific content and extracted into meaningful formats (e.g. JSON) for further processing. Without these technologies working with OCR results is usually time-consuming and error-prone.
Summary
The comparison makes it clear: integrating LLMs into the OCR pipeline is more than a technical upgrade – it is a paradigm shift. Through multimodal processing mere pixels become structured, understandable data.
In the end robustness matters most: while classical approaches often fail even with minor deviations like a skewed scan, the modern pipeline forgives imperfections in the source material and delivers reliable results. Thus OCR changes from a frustrating source of errors to a stable foundation for any modern software architecture.
A guide to implementing LLM-based OCR pipelines will be available in our next article.