Hindi PDF to text: copy first, OCR when it breaks
99.4%
Words right after OCR of clean typed pages
pdftotext and PyMuPDF copy best
| Tool | Chromium | LibreOffice | reportlab |
|---|---|---|---|
| pdftotext | 96.6% | 96.5% | 51.0% |
| PyMuPDF | 96.2% | 98.6% | 53.1% |
| pypdf | 62.6% | 7.4% | 52.1% |
| pdfminer.six | 62.1% | 7.4% | 51.7% |
| pdfplumber | 62.0% | 7.4% | 52.9% |
| PDFKit (macOS) | 58.3% | 19.1% | 52.1% |
No tool copied the reportlab PDFs well. Every one lost all 370 short i signs there.
Why the short i sign goes missing
Hindi stores the short i sign (ि) after its letter but draws it before. Half letters often join the next letter in one shape.
A PDF keeps the shapes. Chromium and LibreOffice also store the real text of each cluster. Of our 6 tools, only pdftotext and PyMuPDF read it. reportlab does not.
| PDF and tool | Copied text |
|---|---|
| Chromium, pdftotext | उनकी निजी संपत्ति |
| Chromium, pdfplumber | उनक␀ ␀नजी संप␀त्त |
| LibreOffice, pdfplumber | उनका5 विनज(cid:22) पु? सिF |
| reportlab, all 6 tools | उनक□ □नजी संप□□ |
␀ is an empty character (NUL). □ is a private-use character: a box, or nothing.
Check the copy first
-
Copy with pdftotext (free, in Poppler):
pdftotext -enc UTF-8 file.pdf out.txt -
Count the short i signs:
grep -o 'ि' out.txt | wc -l. Our 12 test pages hold 185 of them. -
If you get 0, boxes,
(cid:or words starting with a vowel sign, the copy is broken. - Then OCR the pages.
This check fits pdftotext. pypdf kept all 185 signs on a LibreOffice PDF and still got 7.4% of words right.
OCR the page: 99.4% of words
Install Tesseract with Hindi and Poppler (sudo apt install tesseract-ocr-hin poppler-utils, or brew install tesseract-lang poppler on a Mac):
pdftoppm -r 300 -png file.pdf page
for f in page-*.png; do tesseract "$f" "${f%.png}" -l hin -c tessedit_char_blacklist=; done
hin's config blocks the digit 1. Without the last flag, 2012 read as 2042.
| Tesseract | Words right | Numbers right |
|---|---|---|
| hin fast | 99.4% | 46/48 |
| hin best | 99.3% | 47/48 |
| hin fast, no flag | 99.4% | 34/48 |
hin best is about 11 times larger and no better.
OCRmyPDF, one text file
OCRmyPDF (package ocrmypdf) takes the flag from a config file:
echo tessedit_char_blacklist > allow1.cfg
ocrmypdf -l hin --force-ocr --tesseract-config allow1.cfg --sidecar out.txt file.pdf ocr.pdf
| Text | Words right | Numbers right |
|---|---|---|
| OCRmyPDF, out.txt (one font) | 99.0% | 24/24 |
| OCRmyPDF, pdftotext of ocr.pdf (one font) | 77.4% | 24/24 |
Use out.txt.
Our Actor reads scans and page images
Our Apify Actor, PDF to Markdown OCR, reads scanned PDFs and images by URL. With language hin, it read 99.4% of words from these page images.
From build 0.1.144, a hin run reads typed Hindi PDF pages by OCR: 99.0% and 99.1% of words on the Chromium and reportlab files.
- If OCR is unsure, the page keeps its own text, free.
- A page read by OCR costs $0.006, plus $0.00005 to start each run at the default 1 GB of memory.
- We make the Actor, not Tesseract.
Kruti Dev PDFs copy as Latin letters
Some Hindi files use Kruti Dev, an older font that puts Hindi on
English letter codes.
मेरा नाम नेहल है। copies as
esjk uke usgy gSA.
Free converters map it back. We tested 5 on codes, not on a real Kruti Dev PDF: Kruti Dev to Unicode, tested. OCR needs no map.
How we tested
- Text: one passage from each of 12 random Hindi Wikipedia articles, one passage a page.
- Each PDF has 12 pages, 925 words and 185 short i signs.
- Each cell pools the Noto Sans and Noto Serif Devanagari PDFs: 1,850 words.
- PDF makers: Chromium 153, LibreOffice 26.8 and reportlab 5.1.
-
reportlab drew Hindi wrong until we installed uharfbuzz and set
shaping=1on the ParagraphStyle. We tested it with shaping on. - Tools: pdftotext from Poppler 26.03, PyMuPDF 2.2, pypdf 7.1.1.
- Also pdfminer.six 20260107, pdfplumber 0.11.11 and PDFKit, which macOS Preview uses.
- A word counts only if every letter and sign in it is right, in order.
- OCR: Tesseract 5.5.4 with hin from tessdata 4.1.0, on page images at 300 dpi.
- A number counts if it came out right on its own page. With the flag, hin fast got all 12 numbers with a 1 right. Without it, none came out right.
- Other misses with the flag: Noto Serif digits, २०२१ read as २०२९ (fast) and 1958 as 1988 (best).
- No danda (।) became a 1 on these pages. On scans a few can: hin never writes the digit 1.
- OCR ran on the reportlab pages only: every PDF shows the same text in the same fonts.
- Our Actor, run locally: build 0.1.141 for the page images and 0.1.144 for the PDFs. It read the LibreOffice pages by OCR: 99.1%.
- Not tested: Word and InDesign PDFs, scanned PDFs and Kruti Dev files.
- Scripts and results stay in our private repo, in research/bench/hindi-pdf-to-text-2026-11-25/.
Questions people ask
Why is my copied Hindi text broken?
A PDF keeps drawn shapes, and Hindi draws the short i sign before its letter. If the PDF does not also store the real text, or the tool does not read it, the copy loses or moves that sign and garbles half letters.
What is the best free tool for Hindi PDF to text?
In our test, pdftotext and PyMuPDF copied the Chromium and LibreOffice PDFs best: 96.2% to 98.6% of words. When the copy broke, Tesseract with hin read 99.4%.
Is hin best better than hin fast?
Not on these pages: 99.3% of words against 99.4%, from a file about 11 times larger.
Can I convert a scanned Hindi PDF to text?
Yes, with OCR, because a scan has no text to copy. Tesseract Hindi OCR has our test on 94 real scanned pages.
Related guides
- Hindi PDF to Word free: 6 ways tested, plus Kruti Dev to Unicode
- Tesseract Hindi OCR: hin fast vs best vs hin+eng, tested
- PDF text gibberish or (cid:x)? Find the pages, then OCR
- Nepali OCR, tested: free Tesseract models, and Preeti to Unicode
- Marathi OCR, tested: free Tesseract models on 30 scans
- PDF to TXT: 8 free tools tested on hard PDFs
- OCRmyPDF output to text: --sidecar, tested