Image to Text (OCR)
Operator: Abdulla Al Fahad. How tools are built and checked
Optical character recognition turns a picture of text into text you can search, paste and edit. This page runs the open-source Tesseract engine inside your browser tab, so the photo of a letter, the screenshot of a chat or the scanned pages of a PDF are read on your own device. It differs from PDF to Text, which copies the text layer already stored inside a PDF and returns nothing for a scan: here the engine recognises the shapes of letters in the picture itself, so it works on photographs, screenshots and scanned pages that have no text layer at all. You choose the language, press one button, and get the recognised words together with a confidence figure for every page.
It is built for the everyday job of getting words out of something that is only a picture, not for rebuilding a page's layout. You get the text in reading order, as plain text or as a Word file with one paragraph per block, and you are told plainly which pages the engine was unsure about so you know where to proof-read.
Key features
- PNG, JPG, WEBP and PDF input, several files at once, up to 40 pages in total
- 17 languages, up to three combined for mixed-language text
- Per-page status while reading, and a confidence figure for each page plus a weighted average
- Copy to clipboard, download as .txt, or download as .docx with real page breaks between pages
- Cancel at any time; pages already read are kept
- One reusable worker, so reading a second batch in the same language does not download anything again
Languages, page limits and what the confidence number means
Accepted input is PNG, JPG and WEBP images, and PDF files. Images are checked by their first bytes rather than their extension, may be up to 25 MB and 50 megapixels each, and are scaled down so the long side is at most 4000 pixels before reading (they are never scaled up). A PDF may be up to 50 MB; its pages are drawn at 200 DPI, which makes a US Letter page about 1700 by 2200 pixels, and then read one at a time. A PDF that needs a password is refused with a pointer to the unlock tool. You can add several files, up to 40 pages in total across all of them.
Seventeen languages are listed: English, Spanish, French, German, Portuguese, Italian, Dutch, Polish, Turkish, Indonesian, Hindi, Bengali, Arabic, Russian, Simplified Chinese, Japanese and Korean. You may tick up to three at once, and they are passed to the engine as a combined model such as eng+spa for a bilingual letter. More languages make reading slower and can let a wrong word from the other language slip in, so tick only the ones that really appear on the page.
The engine is tesseract.js 7, which runs the Tesseract LSTM engine compiled to WebAssembly, in a Web Worker. The first run downloads the engine's WebAssembly core, which is a few megabytes, and the trained data for each chosen language, which is typically from a couple of megabytes to around fifteen. Both come from a public CDN, and your browser caches them, so the next visit starts faster. Only those program and language files are downloaded; the picture or PDF is never sent anywhere.
Confidence is Tesseract's own 0 to 100 estimate for a page. The summary figure weights each page by the number of non-blank characters it produced, so a mostly empty cover page does not drag a well-read report down. Under about 60 percent the page list turns red, 60 to 84 is amber and 85 and above is green. These are guides, not accuracy percentages: a confident page can still contain a wrong digit.
How it works
Each image is decoded with its camera orientation applied, flattened onto white (so a transparent PNG does not become black) and scaled to the size limit. Each PDF page is rendered by pdf.js at 200 DPI onto a white canvas. The canvas goes straight to the Tesseract worker, which segments it into lines and recognises each line with a neural network, then returns the text and a mean confidence for the page.
The text of several pages is joined for copying and for the TXT file with a line such as ----- report.pdf, page 2 ----- between them, so you can find a page again. The Word file instead puts a page break between pages and splits the text into paragraphs wherever the engine left a blank line, keeping single line breaks inside a paragraph.
Cancel stops waiting for the current page and shuts the worker down. Because a shut-down worker cannot be resumed, the next run starts a new one, which usually comes from the browser cache.
Common use cases
- Copying the clauses of a lease that exists only as a scan into an email so the landlord can be asked about one paragraph
- Pulling the figures out of a photographed receipt so they can be pasted into an expenses sheet
- Turning a screenshot of a chat or an error message into text that a support agent can search
- Reading a scanned page in Hindi, Bengali or Arabic and pasting it into a document for translation
- Making the pages of an old typed report editable as a Word file
How to use this tool
- Drop one or more images or PDFs onto the box, or click it to choose them.
- Tick the language of the text, up to three if the page mixes languages.
- Press Read pages. The first run shows a download step; later runs go straight to reading.
- Watch the per-page status, and check the confidence list on the right when it finishes.
- Copy the text, or download it as TXT or DOCX. Proof-read any red or amber page against the original.
Example
A scanned three-page lease, scanned.pdf, language English
3 PDF pages, each drawn at 200 DPI as 1700 x 2200 pixels
page 1: 2000 characters read, confidence 94
page 2: 1800 characters read, confidence 91
page 3: 400 characters read, confidence 72 (signature page, a stamp over the text)What the page reports
Summary confidence = (2000x94 + 1800x91 + 400x72) / 4200 = 90.6, shown as 91%
Page list: page 1 green, page 2 green, page 3 amber, so the signature page is the one to check by eye
scanned.txt three blocks separated by ----- scanned.pdf, page N -----
scanned.docx the same text with a page break after pages 1 and 2Tips for best results
- Photograph or scan at an angle as close to straight on as you can. Tesseract copes with a small tilt but reads a steep perspective badly; the Document Scanner on this site flattens a skewed photo first.
- For a phone photo of text, make sure the letters are at least 20 to 30 pixels tall in the picture. A distant wide shot of a poster gives the engine too little to work with.
- Tick one language when you can. Adding a second only helps when the page genuinely contains it.
- A black-and-white or high-contrast scan reads better than a coloured background with a pattern behind the text.
- Read the red and amber pages first when proof-reading; that is where most of the mistakes will be.
Edge cases to watch
Handwriting is not supported. Tesseract is trained on printed type, so handwritten notes will come out as nonsense with a low confidence.
Layout is not rebuilt. Columns, tables and text boxes come out as a sequence of lines, and a table loses its grid. For tables use a table-aware PDF tool.
The output is plain text, not a searchable PDF. The page does not write the recognised text back into a PDF.
Numbers and look-alike characters are the usual casualties: 0 and O, 1 and l, 5 and S. Check every amount, date and account number against the original.
A very large page is capped. A PDF page longer than about 25 inches (a little over A2) is drawn with its long side limited to 5000 pixels, so tiny print on a poster-size sheet may be unreadable.
Reading time depends on your device. Expect several seconds per page on a laptop and noticeably longer on an older phone.
Common errors and how to fix them
- The OCR engine could not start
- The engine and language data are fetched on the first run. Check that the connection is up and that a content blocker is not stopping the CDN, then press the button again.
- No text was found
- The picture may be too small, blurred or low in contrast, or the wrong language is ticked. Retake it closer and sharper, or choose the language that matches the writing.
- This PDF is password-protected
- Remove the password with the Unlock PDF tool first, then read the unlocked file.
- A file was left out because the page limit was reached
- The limit is 40 pages in total. Split the PDF into parts, or read the files in separate batches.
Best practices
- Read one clean page first and compare its figures with the original before starting a long batch, so a wrong language choice shows up on page one instead of page forty.
- Read long documents in batches under the limit and save each batch's text before starting the next.
- Choose DOCX when you will edit the text and TXT when you will paste it somewhere else.
What is downloaded and what stays put
Three kinds of file travel to your browser the first time you read a page: the Tesseract worker script, its WebAssembly core, and the language data. All three are program code or reference data that are the same for every visitor. Nothing about your own file is included in those requests.
Your picture or PDF is read into memory in this tab, drawn on a canvas, handed to the worker running in the same browser, and released when its page is done. Closing the tab discards the text; the page does not store it in browser storage.
When the confidence number misleads
A page of clean 12-point type usually scores in the nineties, and a smudged photocopy or a phone shot in poor light will score much lower. But the figure describes the engine's certainty, not the truth. A confidently misread digit in an account number is possible, which is why numbers deserve a second look whatever the score.
A page can also score high and hold very little text, for example a page with one large heading. That is why the summary is weighted by characters rather than being a plain average of the pages.
Frequently asked questions
Why is the first run slow?
The first run downloads the engine and the data for the chosen language. After that the browser keeps them, so later runs start reading straight away.
Can it read handwriting or a table?
No. It reads printed text and returns it as lines; handwriting comes out unreliable and a table loses its grid.
Does it make a searchable PDF?
No. It outputs text, as a TXT or a Word file. The original PDF is not changed.