What Is OCR (Optical Character Recognition)?
OCR (Optical Character Recognition) extracts readable text from images, screenshots, photos, and scanned documents. Instead of manually retyping text from a picture, this tool identifies characters in the image and converts them to selectable, copyable, searchable text. The recognizer is Tesseract (Apache-2.0), the open-source engine Google sponsored for a decade, compiled to WebAssembly by the tesseract.js project and run here in your browser tab. It reads printed and on-screen text in photos, screenshots and scans; it was not built for handwriting, and we have not tested it on any.
Common OCR Use Cases
Use OCR to extract text from screenshots of chat messages, error logs, or UI mockups. Digitize printed documents — receipts, invoices, business cards, and letters. For scanned PDFs, use the PDF OCR tool, which runs the same engine page by page and can write a searchable PDF. Copy code from screenshots shared in forums or tutorials.
How to Use This Tool
- Add an image — Drop it on the box, choose a file, or paste a screenshot with Ctrl+V / Cmd+V. PNG, JPEG, WebP, GIF and BMP work (anything the browser itself can decode).
- Pick the language — Choose the language the text is written in. The first run in a language downloads that language’s model (0.7 to 3.0 MB); the browser caches it.
- Leave layout and upscale on auto — Change the layout only when auto fails: “one block” for a paragraph crop, “sparse” for screenshots with scattered labels, “single line” for one line.
- Extract and check — Press Extract Text. The result opens in an editable box with the mean confidence and a list of words the engine scored under 60%; check those first, then copy the text or download it as .txt.
Worked example: how text size changes accuracy
On October 12, 2026 we rendered test images in headless Chromium, ran each one through this page in Chromium with the same tesseract.js 5.1.0 build it loads for you, and compared the output with the text we typed. The score is the character error rate (CER): the edit distance between output and truth divided by the length of the truth, after collapsing runs of whitespace. 0% means every character came back. First, the same three English lines in DejaVu Sans at nine sizes, captured at one image pixel per CSS pixel, as a normal 1x screenshot would be:
| Font size | Text line height | CER at 1x | CER at 2x | CER at 3x | CER with auto |
|---|---|---|---|---|---|
| 8 px | 9 px | 16.4% | 0% | 0% | 0% (re-read at 4x) |
| 9 px | 9 px | 7.0% | 0% | 0% | 0% (re-read at 4x) |
| 10 px | 10 px | 2.8% | 0% | 0% | 0% (re-read at 4x) |
| 12 px | 13 px | 0% | 0% | 0% | 0% (re-read at 3x) |
| 14 px | 14 px | 0% | 0% | 0% | 0% (re-read at 3x) |
| 18 px | 18 px | 0% | 0% | 0% | 0% (read once at 1x) |
| 24 px | 24 px | 0% | 0% | 0% | 0% (read once at 1x) |
| 32 px | 31 px | 0% | 0% | 0% | 0% (read once at 1x) |
| 48 px | 47 px | 0% | 0.5% | 1.4% | 0% (read once at 1x) |
Below about 12 px the error rate climbs fast: at 8 px one character in six comes back wrong, and Tesseract’s own confidence drops to 61%. Enlarging the same image 2x before recognition brings every size back to zero. That is why Upscale: auto, the default, reads the image once, measures the median height of the text lines Tesseract found, and if they are under 16 px tall, reads it again enlarged so the lines are about 32 px, keeping whichever pass has the higher mean confidence. Large text is left alone on purpose: at 48 px, 2x and 3x copies did slightly worse than the original.
The six harder English images, each read at 1x, 2x and with auto:
| Test image | CER at 1x | CER at 2x | CER with auto | Mean confidence (auto) |
|---|---|---|---|---|
| Clean UI text, 16 px | 0% | 0% | 0% | 95% |
| Small print, 11 px | 0.5% | 0% | 0% | 95% |
| Dark-mode terminal, 15 px light on #1e1e1e | 5.1% | 1.9% | 1.9% | 90% |
| Code screenshot, 13 px monospace | 4.5% | 0.9% | 0.9% | 83% |
| Low contrast, #9a9a9a on #e6e6e6 | 0% | 0% | 0% | 95% |
| Photo of a page: 2.2° tilt, uneven light, noise, blur, JPEG q40 | 0.5% | 27.3% | 0.5% | 95% |
Two failures are worth knowing about. The photographed page read almost perfectly at 1x (one lost space, “ata quarter”) but lost 27% of its characters at 2x, because Tesseract’s layout analysis cut the enlarged lines short. The code screenshot’s characters came through, but its indentation did not: Tesseract returns lines of words, not the leading spaces of a code block, so re-indent pasted code. Inverting the dark-mode screenshot ourselves made no difference (5.1% at 1x either way), because Tesseract already retries any line it reads with low confidence on an inverted copy of the image; we removed the invert option for that reason.
The other nine languages, one short paragraph each in the languages’ own scripts:
| Language (17–22 px text) | CER at 1x | CER at 2x | CER with auto |
|---|---|---|---|
| Spanish | 0% | 0% | 0% |
| French | 0% | 0% | 0% |
| German | 0% | 0% | 0% |
| Italian | 0% | 0% | 0% |
| Portuguese | 0% | 0% | 0% |
| Japanese | 0% | 0% | 0% |
| Chinese (Simplified) | 0% | 0% | 0% |
| Korean | 0% | 66.7% | 0% |
| Arabic | 2.6% | 2.6% | 2.6% |
Korean shows the same trap as the photo: enlarged 2x, its 40 px lines were split into scattered fragments and two thirds of the text was lost, while 1x and auto were exact. Arabic came back with every letter but three missing spaces (“التاسعةصباحا”), which is the whole 2.6%. Japanese and Chinese were scored without spaces, since neither language puts spaces between words.
Why enlarging helps small text and can hurt large text
Tesseract 4 and later recognize text one line at a time with an LSTM neural network. Gilbey and Schönlieb (Cambridge, 2021) describe the pipeline: the page is first split into blocks, paragraphs and lines, then each line is rescaled to the network’s fixed input height of 36 pixels. Lines that start out only 9 or 10 pixels tall have very little detail left for that rescale to work with, and the models were trained on 300 dpi scans. In their tests on 60 dpi scans, plain Tesseract on bicubic-enlarged images still reached 96.6% to 99.7% character accuracy depending on the font, against 99.7% to 100% on the original 300 dpi scans, which matches the small-text losses in our first table.
The layout step runs before that, on the whole image, and it is the part that broke on our enlarged photo and Korean samples. Tesseract’s own guidance points the same way: it lists rescaling, binarisation, noise, skew and page segmentation mode as the main causes of bad output, notes that a skewed page “significantly” reduces line segmentation quality, and suggests a different segmentation mode when you only need a small region. The layout menu here maps to those modes: automatic (mode 3), one block (6), sparse text (11) and a single line (7). We dropped mode 4 (“single column of varied sizes”) after it read the tilted photo as two columns and scrambled 61% of it.
Preprocessing matters more as images get worse. Sporici and colleagues (2020) ran Tesseract 4.0 on a dataset of difficult real-world images and found character-level accuracy of only 0.134 on the raw images, rising to 0.616 with learned convolution filters applied first. This tool only converts to grayscale and enlarges small text; for curled pages, glare or heavy blur, a straighter, sharper photo will help more than any setting.
What the confidence number means
Tesseract gives every word a confidence from 0 to 100 and the page a mean. On clean text it tops out around 95 (it never reported more than 95 in our runs; Gilbey and Schönlieb note it never exceeds 97). In our set, every image at 92% or above came back with at most three wrong characters, and the two lowest scores (83% on the code screenshot, 61% on 8 px text at 1x) were also the two worst readings at that size. Use it as a flag, not a guarantee: the words listed under 60% are the ones to check first.
What runs where
Your image never leaves the device. It is drawn to a canvas, converted to grayscale and handed to a Web Worker running Tesseract. What the page downloads, once, from the jsDelivr CDN: the tesseract.js 5.1.0 loader (67 KB), its worker script (124 KB), the WebAssembly core (3.9 MB) and the trained model for the language you pick (0.7 MB for French up to 3.0 MB for English, from the 4.0.0_best_int set). After that the browser cache serves them. The Paste Image button uses the asynchronous Clipboard API, supported since Chrome 76, Safari 13.1 and Firefox 127 (Firefox shows its own paste prompt); Ctrl+V / Cmd+V on the page works everywhere.
Sources
Checked on .
- Gilbey & Schönlieb (2021), An end-to-end Optical Character Recognition approach for ultra-low-resolution printed text images, arXiv:2105.04515
- Sporici, Cușnir & Boiangiu (2020), Improving the Accuracy of Tesseract 4.0 OCR Engine Using Convolution-Based Preprocessing, Symmetry 12(5)
- Tesseract documentation: Improving the quality of the output
- Tesseract release notes (5.2.0: invert_threshold, default 0.7)
- tesseract.js 5.1.0 (Apache-2.0) on npm
- MDN: Clipboard.read() (with browser compatibility data)
Frequently Asked Questions
Built by Derek Giordano · Part of Ultimate Design Tools