How accurate is in-browser OCR? Font size, language, photo vs scan

By Rundong LiPublished 13 min read

The short answer: for clear printed text at 12 pixels or larger, our in-browser OCR got about 98% of the characters right in English. At 16 px it got more than 99% right, and at 24 px it was close to perfect. Below 10 px it fell apart: at 8 px most of the text was wrong, and at 6 px it returned nothing at all. The cheapest fix was surprising: enlarging a small screenshot to twice its size before reading it took 8 px text from a 73–94% error rate down to 0.1–2.3%. Tilt did more damage than compression: a 5° slant made 12 px text about 16% wrong, while JPEG quality 15 made it only 2.5% wrong.

What we tested

Our image to text tool runs Tesseract.js 7 in your browser, using the compact LSTM language models it downloads from a public CDN. It offers six languages. To measure accuracy you need to know exactly what the image says, so we made our own images. We took the first three clauses of the Universal Declaration of Human Rights preamble in all six languages, the opening of Pride and Prejudice from Project Gutenberg, and a block of made-up reference codes, dates, prices and phone numbers. We rendered them as black text on white in Times New Roman, Arial and Courier New, or Songti and PingFang for Chinese and Hiragino Mincho and Hiragino Sans for Japanese, at sizes from 6 to 32 px.

Then we damaged copies of four of them in 34 different ways: JPEG compression, rotation, blur, noise, low contrast and a simulated phone photo. We made 391 readings of the 379 images in the tool, choosing the language in the menu as a user would. We score two things. Character error rate (CER) is the number of characters you'd have to insert, delete or change to get the true text, divided by its length. Word error rate (WER) is the same thing counted in words. A CER of 2% means about one wrong character in every 50. The full method is at the end.

Font size matters most

English, character error rate / word error rate, averaged over three passages (about 700–790 characters each). Size is the CSS font size in an image at 1 pixel per CSS pixel, like a screenshot at 100% zoom. Tested in Chromium on an Apple M2 Mac.
Text sizeSerif (Times New Roman)Sans (Arial)Mono (Courier New)
6 px100% (no text)100% (no text)100% (no text)
7 px93.7% / 100%90.0% / 99.0%95.3% / 99.5%
8 px84.9% / 98.9%81.0% / 97.1%75.3% / 95.4%
9 px81.6% / 97.6%27.3% / 70.1%69.8% / 87.2%
10 px20.2% / 56.3%12.2% / 45.2%16.2% / 33.1%
12 px2.5% / 12.5%1.4% / 7.5%2.0% / 8.2%
16 px0.9% / 5.9%0.4% / 2.9%0.3% / 2.4%
24 px0.4% / 2.3%0.0% / 0.3%0.3% / 1.8%
32 px0.0% / 0.3%0.0% / 0.3%0.5% / 2.1%

There is a cliff between 9 and 12 px. At 10 px the tool still got most words right, but one in two or three came out wrong. At 12 px most errors were small: a stray quotation mark at the start of a line, or a 5 read as S. At 6 px Tesseract found no text at all. When we ran the test, the tool then showed an empty box with no message, which looked like it hadn't run. It now says no text was found and suggests enlarging the image first.

To relate this to a scan: font size in pixels is the point size times the scan resolution divided by 72. Ordinary 10 pt print scanned at 300 dpi comes out at about 42 px, far into the safe zone. At 150 dpi it is about 21 px, which is still fine. At 72 dpi it is 10 px, right on the cliff. Small print in screenshots is the usual problem.

Monospaced codes never got to zero. In our passage of reference codes and phone numbers set in Courier New, 1.4% of characters were still wrong at 32 px. The tool read 1 as l, 0 as O and 5 as b, mistakes that don't happen with normal words. Always check codes, account numbers and amounts by eye.

Six languages

Character error rate on the same text, the first three clauses of the UDHR preamble, with the matching language chosen in the tool. Latin passages are 690–790 characters; Chinese 164 and Japanese 221 characters. Spaces are ignored for Chinese and Japanese.
LanguageFont8 px10 px12 px16 px24 px
EnglishSerif88.2%10.3%1.6%0.7%0.4%
EnglishSans73.0%11.3%0.7%0.3%0.0%
SpanishSerif71.9%9.6%0.6%0.0%0.0%
SpanishSans93.3%3.3%0.6%0.1%0.0%
FrenchSerif80.1%11.1%1.1%0.0%0.0%
FrenchSans83.1%7.2%0.3%0.0%0.0%
GermanSerif30.2%1.1%0.4%0.0%0.0%
GermanSans64.8%1.2%0.3%0.0%0.0%
Chinese (Simplified)Songti (serif)75.6%30.5%6.7%3.0%3.0%
Chinese (Simplified)PingFang (sans)61.0%18.9%4.9%3.7%3.7%
JapaneseHiragino Mincho (serif)46.6%12.7%4.5%1.4%1.4%
JapaneseHiragino Sans43.9%10.0%1.8%0.9%0.9%

Spanish, French and German behaved like English. Each was at or under 1.1% at 12 px and effectively perfect at 16 px.

Chinese and Japanese need bigger text: they reached their best at 14–16 px rather than 12. Chinese also had an error floor. Even at 32 px, 3–5% of characters were wrong, mostly a handful of less common characters, for example 蔑 read as 茂, 蛮 as 刘, 玷 as 天. Japanese levelled off at 0.9–1.4%. If you need Chinese text exactly, check unusual characters by eye. There is also a formatting problem: the tool's Chinese and Japanese output has spaces between most characters. Our 164-character Chinese passage came back with 124 spaces, and the 221-character Japanese one with 160. Our scores ignore them. After this test we changed the tool to remove spaces between Chinese and Japanese characters, so you no longer have to delete them by hand.

Choosing the wrong language

For European languages, leaving the menu on English costs a little. At 16 px, French read with the English model had a 3.3% error rate instead of 0.0%, German 2.3% and Spanish 0.8%. Almost every error was a lost or mangled accent: é became 6, ß became B, ü became ii. At 12 px in Times New Roman the gap was larger: 3.8–6.9% instead of 0.4–1.1%. For Chinese and Japanese the choice is essential. Read with the English model, both came out almost entirely wrong (98–102%; the rate can go over 100% when the output is longer than the text). Chinese read as Japanese was 34% wrong, and Japanese read as Chinese 68%.

Damage: what breaks OCR and what doesn't

Character error rate. Blur is a Gaussian blur with the given radius (standard deviation). Noise is random grey-level noise with that standard deviation on a 0–255 scale. Contrast is the gap between text and background as a share of the full black-to-white range. Phone photos are described under How we tested.
DamageEnglish sans 12 pxEnglish serif 20 pxCodes sans 16 pxChinese sans 20 px
None (clean PNG)0.7%0.0%0.2%3.7%
JPEG quality 601.0%0.1%0.2%3.7%
JPEG quality 301.5%0.0%0.5%3.7%
JPEG quality 152.5%0.0%0.4%2.4%
JPEG quality 88.8%0.0%1.5%4.3%
Rotated 1°0.9%0.1%0.1%3.7%
Rotated 2°2.5%0.0%2.1%4.9%
Rotated 3°4.6%0.0%3.5%7.9%
Rotated 5°16.4%2.6%15.7%50.6%
Rotated 10°33.7%16.7%29.3%92.7%
Rotated 90°91.3%81.0%87.0%100%
Upside down (180°)84.3%85.8%88.3%99.4%
Rotated 5°, then straightened0.6%0.1%0.2%3.7%
Blur, radius 0.5 px2.5%0.0%0.1%3.0%
Blur, radius 1 px6.4%0.0%0.8%2.4%
Blur, radius 1.5 px63.6%1.5%16.4%14.0%
Blur, radius 2 px88.7%19.6%52.6%37.2%
Noise, strength 251.3%0.0%0.4%3.0%
Noise, strength 509.3%5.2%7.8%9.2%
Pale grey text, 6% contrast, no noise0.3%0.0%0.2%3.7%
25% contrast plus light noise2.3%0.0%0.6%3.7%
12% contrast plus light noise77.2%58.8%53.8%76.2%
Simulated phone photo, mild0.0%0.0%0.0%4.3%
Simulated phone photo, medium1.6%0.9%1.4%6.7%
Simulated phone photo, harsh43.2%7.7%16.4%25.6%

JPEG compression barely mattered. Text at 20 px survived quality 8, the blockiest setting we tried, without a single extra error. Only small text suffered: 12 px went from 0.7% to 2.5% at quality 15 and 8.8% at quality 8.

Tilt mattered a lot. Tesseract handles a degree or two, but at 5° the error rate on 12 px English jumped to 16.4% and on Chinese to 50.6%. Bigger text tolerated more: 20 px serif was still clean at 3°. Text turned 90° or upside down came out as nonsense, because the tool doesn't detect page orientation. In every case, rotating the image back to level restored the clean result.

Blur is the other big killer, and how much it hurts depends on the text size. A blur radius of 1 px cost 12 px text 6% of its characters. At 1.5 px, 12 px text was 64% wrong, while 20 px text lost only 1.5%.

Low contrast on its own did nothing. Pale grey text only 15 grey levels darker than its background (6% contrast) was read as well as black text, because the engine sets its black-and-white threshold from the image itself. It was the combination with noise that failed: at 12% contrast with light noise, the error rate went past 50% on every passage. Raising brightness and contrast afterwards didn't bring it back (47–75% after a 70% brightness, 200% contrast pass), because that stretches the noise along with the text. Faded receipts photographed in dim light are exactly this case.

Phone photos were fine when they were reasonable. Our mild and medium simulations, with a page at an angle under uneven light with slight blur and noise, scored within a few points of the clean image. The harsh one, with a strong angle, a deep shadow and more blur, scored 8–43% wrong. Raising brightness to 120% and contrast to 150%, as our brightness and contrast tool can, cut the error in six of the eight harsh cases we tried. For example, 20 px serif went from 7.7% to 4.2%. But no harsh case came close to clean. Cropping the plain desk background away didn't help, and in the harsh cases the error went up. Cropping still matters when other text surrounds the part you want, which we didn't test.

Enlarging small text before OCR

Character error rate. Enlarged in the browser with smooth (high-quality) scaling, the same method our resize tool uses. No detail is added, only more pixels.
TextAs capturedEnlarged 2×Enlarged 3×
English serif 6 px100%34.0%22.8%
English sans 6 px100%36.4%23.1%
English mono 6 px100%7.5%6.7%
English serif 8 px88.2%1.7%1.5%
English sans 8 px73.0%2.3%1.6%
English mono 8 px94.3%0.1%0.3%
English serif 10 px10.3%0.4%0.0%
English sans 10 px11.3%0.0%0.0%
Codes, sans 8 px84.4%3.6%5.5%
Chinese sans 8 px61.0%19.5%21.3%
Chinese sans 10 px18.9%4.3%6.1%
Japanese sans 8 px43.9%11.8%15.8%
Japanese sans 10 px10.0%2.7%3.2%

This was the biggest effect in the test. Enlarging adds no information, yet doubling an 8 px screenshot took English from a 73–94% error rate to 0.1–2.3%, and 10 px text to almost zero. Twice the size was enough. Three times gave little extra for English and was slightly worse for Chinese and Japanese. Enlarging helped Chinese and Japanese too, but less: 8 px Chinese stayed about 20% wrong. At 6 px too much of each letter is missing: even enlarged, it stayed 7–36% wrong.

Download size and speed

Bytes as transferred (compressed). The total includes the shared engine, about 1.41 MB. Times are from pressing Extract to the text appearing, for a 16 px passage, on a fast connection; later runs are the median of three. One run per language, so treat the times as rough.
LanguageLanguage model downloadTotal first-use downloadFirst extractionLater extractions
English2.95 MB4.36 MB1.6 s0.75 s
Spanish2.10 MB3.50 MB1.8 s0.85 s
French0.71 MB2.11 MB1.2 s0.55 s
German1.33 MB2.74 MB1.8 s1.0 s
Chinese (Simplified)1.72 MB3.12 MB1.7 s0.96 s
Japanese2.03 MB3.43 MB1.9 s1.2 s

The first time you use a language, the browser downloads the engine (about 1.4 MB, shared by all languages) and that language's model (0.7–3.0 MB). Both are kept for next time. On our fast connection that added under a second. On a 10 Mbit/s connection, 4.4 MB is about 3.5 seconds of download by simple arithmetic. After that, a paragraph took 0.5–1.2 seconds, and bigger images took longer: the same English text took about 0.6 s at 10 px and 1.3 s at 32 px, and a medium phone photo took 1.6 s.

How to get accurate text out of an image

  1. Make the text big enough. Aim for letters at least 12 px tall in the image, 16 px for Chinese and Japanese. Zoom in before taking a screenshot, or scan at 150–300 dpi.
  2. If the text is small, enlarge it. Doubling the size with resize image before OCR fixed 8 and 10 px English text in our test. Doubling is enough; three times rarely helps more.
  3. Straighten it. Keep tilt under 2°. If a photo is sideways or upside down, turn it with rotate image first; the OCR tool won't do it for you. For a slight slant, take the photo again square-on or straighten it in a photo editor.
  4. Focus and light beat editing. A sharp, evenly lit photo taken straight on scored almost like a scan; blur and deep shadow can't be undone.
  5. Try more contrast on dim photos. In brightness and contrast, around 120% brightness and 150% contrast helped most harsh photos in our test. It won't rescue faint text that is grainy.
  6. Crop to what you need with crop image when other text, logos or pictures surround it. On a plain background it didn't help in our test.
  7. Pick the right language in the menu, always for Chinese and Japanese. And check numbers, codes and unusual characters by eye: those were wrong even when everything else was right.

How we tested

Texts: the first three clauses of the UDHR preamble in English, Spanish, French, German, Simplified Chinese and Japanese (UN texts, from the UDHR in Unicode collection as packaged in the NLTK data corpus), the opening 19 lines of chapter 1 of Pride and Prejudice (Project Gutenberg eBook #1342, public domain), and eight lines of made-up codes, dates, prices, phone numbers and email addresses. We rendered each passage in headless Chromium as black text on white, with a column 34 em wide (24 em for Chinese and Japanese), line height 1.4 and no hyphenation. We saved each as a PNG at 1 image pixel per CSS pixel. English used three fonts at 6, 7, 8, 9, 10, 12, 16, 24 and 32 px. Spanish, French and German used serif and sans at 7–24 px, and Chinese and Japanese used serif and sans at 8–32 px.

We damaged four of the images (English sans 12 px, English serif 20 px, codes in sans 16 px and Chinese sans 20 px) with Pillow and scikit-image, using a fixed random seed. The damage was JPEG at quality 90, 60, 30, 15 and 8; bicubic rotation by 1, 2, 3, 5, 10, 90 and 180° on white; the 5° and 10° versions rotated back; Gaussian blur at radius 0.5–3 px; Gaussian noise with a standard deviation of 10, 25 and 50; and text-to-background contrast of 50%, 25%, 12% and 6% on a light grey page, with and without noise of strength 8. For the phone photos, we doubled the page in size, placed it on a grey background and warped its corners to an angle of 3%, 7% or 12% of the page width. We then added a light falloff and shadow of 25%, 45% or 65%, a warm colour cast, blur of 0.8, 1.3 or 2 px, noise of 4, 7 or 11, and saved them as JPEG at quality 88, 80 or 70. Crops cut to the page's corners; brightness and contrast used the CSS filter formula our tool uses; enlargements used a browser canvas with smooth scaling, as our resize tool does.

On 24 October 2026, Playwright drove the production build of our image-to-text page in Chromium 156 on an Apple M2 Mac. For each image it chose the file, set the language menu, pressed Extract text and read the output box. All other network hosts were blocked except the CDN that serves the engine. To score each result, we applied Unicode NFKC normalisation and straightened curly quotes in both texts. For Latin text we collapsed all whitespace to single spaces; for Chinese and Japanese we removed it. Then we counted the Levenshtein edit distance in characters, and for Latin text also in words, and divided by the length of the true text. We measured download sizes and times in a fresh browser profile for each language, with the browser cache left on. Our general testing approach is described in how we test the tools.

Limits: these are rendered images, not real scans, so they are cleaner than paper. Real print has ink spread, paper texture, curved pages near the spine and mixed layouts, all of which will make results worse. Our phone photos are a simulation, not a camera. Each language has one passage, and each damaged case one image, so differences of a percentage point or two are within the noise. Columns, tables, handwriting and decorative fonts were not tested. All timings come from one fast machine and connection; a phone will be slower.

Tools mentioned in this article

More from the blog