# Why Does OCR Get Numbers Wrong? Digits, Dates, Decimals

- Author: Schema Law (https://www.schemalaw.com/)
- Published: 2022-09-23T02:50:56Z
- Updated: 2026-10-11T19:22:20Z
- Category: Difficult scans
- Canonical: https://www.schemalaw.com/blog/why-does-ocr-get-numbers-wrong

> Why does OCR get numbers wrong? A digit has no context to confirm it. See which digits swap, how dates and decimals fail, and the checks that catch them.

OCR gets numbers wrong because a digit has nothing around it to confirm it. A misread letter usually produces a non-word that software or a reader catches. Any digit can follow any other, so a wrong 8 looks as valid as the right 3. Catch the mistakes with arithmetic, cross-references and a character-by-character read against the image.

## Why are numbers harder for OCR than words?

Numbers are harder for OCR than words because words carry spare information and numbers carry none. If one letter of "agreement" is doubtful, the other eight settle it. If one digit of 48,310 is doubtful, the other four say nothing about it. Every digit has to be read correctly from its own shape.

Software leans on that spare information too. The documentation for the open-source Tesseract engine says that by default it is ["optimized to recognize sentences of words"](https://tesseract-ocr.github.io/tessdoc/ImproveQuality.html), and it suggests different settings for anyone trying to read receipts, price lists or codes. The help that ordinary prose gets from vocabulary is unavailable to a column of figures.

Four more things work against numbers.

- **Ten shapes built from the same parts.** Digits are loops, hooks and straight strokes in different arrangements. A 3 is an 8 with the left side open. A 6 is an 8 with the top right open.
- **Smaller type.** Figures live in tables, schedules and statements, which are set smaller than body text and packed between ruled lines.
- **Punctuation inside the value.** A comma, a period, a minus sign or a pair of parentheses is part of the number, and each is among the smallest marks on the page.
- **No alarm goes off.** Spellcheck underlines "agreernent". Nothing underlines 48,810. Your eye passes over a wrong figure as easily as the software did, because it is a perfectly good number.

The last point is the one to hold on to. Errors in words tend to announce themselves. Errors in numbers stay quiet until someone relies on the figure.

On a promissory note those quiet errors sit in the principal, the interest, and the collateral line. You check the lender's name and the security interest clause as carefully as the dollar figure, because a wrong digit in either place points at a different loan. Recompute any total the note prints.

## Which digits and letters get swapped most often?

The swaps follow shape. Digits that differ by one small gap or one short stroke trade places with each other, and digits trade places with the letters they resemble. Which swap you get depends on whether the copy is too heavy, too light or too coarse.

### Digit for digit

| Pair | What separates them | What removes the difference |
| --- | --- | --- |
| 3 and 8 | Two openings on the left of the 3 | A heavy copy closes them; a light copy opens an 8 |
| 6 and 8 | The open top right of the 6 | Ink spread or a coarse scan |
| 5 and 6 | The gap at the lower left of the 5 | Ink spread |
| 0 and 8 | The waist of the 8 | Low resolution, or a slashed or dotted zero |
| 1 and 7 | The top bar of the 7 | Faint print, or a 1 with a long flag |
| 4 and 9 | An open or closed top on the 4 | Typeface; some 4s are closed at the top |
| 5 and 3 | The square top left corner of the 5 | A light copy that drops the vertical stroke |
| 0 and 6 or 9 | A short tail | Faint print |

### Digit for letter

| Digit | Letters it trades with | Where it bites |
| --- | --- | --- |
| 0 | O, D, Q | Account and policy numbers that mix letters and digits |
| 1 | l, I, the vertical bar | Anything typed; subsection labels; column rules read as digits |
| 2 | Z | License plates and part numbers |
| 5 | S | Unit and suite numbers such as "5B" and "SB" |
| 6 | b, G | Codes in capitals or in lower case |
| 8 | B | Building and apartment labels |
| 9 | g, q | Lower-case codes |

### The copy decides the direction

A dark photocopy thickens strokes, so open shapes close: 3 drifts to 8, and 5 and 6 drift to 8 as well. A pale copy thins strokes, so closed shapes open: 8 drifts to 3, and 0 may break into a pair of parentheses. A coarse scan blurs both ways. Knowing which kind of page you have tells you which wrong digits to hunt for. The post on [OCR for a low resolution scan](https://www.schemalaw.com/blog/ocr-low-resolution-scan) shows how to measure whether a file is coarse.

Typeface matters too. A zero with a slash through it can come back as 8 or as the letter Ø. On old typed pages the typist may really have struck a lowercase L for the digit one, and the post on [OCR for typewritten documents](https://www.schemalaw.com/blog/ocr-typewritten-documents) explains why.

### Errors of count

Not every number error is a swap. Watch for a digit read twice, a digit dropped from a run of identical ones (so 1,000 becomes 1,00), a space opened inside a figure, and two neighboring columns fused into one long number. Counting digits catches these where reading does not.

These pairs are one family among several. The broader list, covering names, citations and small words, is in the section on [the error patterns that matter in legal text](https://www.schemalaw.com/blog/why-is-ocr-output-full-of-errors#the-error-patterns-that-matter-in-legal-text).

## Decimal points, thousands commas and negative amounts

Decimal points, thousands commas and the signs that mark a negative amount are the smallest marks on a financial page and the ones with the largest effect. A lost decimal point multiplies a figure by a hundred. A lost minus sign reverses it. Check the punctuation of every figure you rely on, as well as its digits.

| Mark | How it fails | Example on the page | Example in the output |
| --- | --- | --- | --- |
| Decimal point | Dropped | 1,250.00 | 1,25000 |
| Decimal point | Created from a speck | 12500 | 125.00 |
| Comma | Read as a period, or the reverse | 1,250 | 1.250 |
| Comma | Read as a space | 12,500 | 12 500 |
| Leading minus | Dropped, or joined to the previous column | -340.00 | 340.00 |
| Trailing minus | Dropped or read as a stray dash | 340.00- | 340.00 |
| Parentheses | Read as 1, l, C or dropped | (340.00) | 1340.001 |
| CR or DR suffix | Split off into the next column | 340.00 CR | 340.00 |
| Dollar sign | Read as 5, 8 or S | $125.00 | 5125.00 |
| Percent sign | Read as 96 or as 0/0 | 4.5% | 4.596 |
| Superscript note marker | Joined to the figure | 2,400 with a raised 1 | 2,4001 |

Two of these are worth a closer look.

**Parentheses.** Accountants write negatives in parentheses. If the brackets are read as the digit 1, a loss of 340.00 becomes a gain of 1,340.001. The extra decimal place is your clue: any amount with three digits after the point, or one, deserves a look at the image.

**Color.** Some statements print negative amounts in red with no other sign. A black-and-white scan keeps the digits and throws away the only thing that made them negative. No amount of proofreading the text will find that. You need a color copy or the paper.

### Damage done after recognition

A correct number can still be ruined on its way into a spreadsheet. Opening a CSV file by double-clicking lets the spreadsheet program guess what each cell is. It strips leading zeros from ZIP codes and account numbers, turns long identifiers into scientific notation, and converts entries such as "3-4" into dates. Import the file and set identifier columns to text. Schema Law exports Excel, CSV and JSON on every plan, the free one included, and the [pricing page](https://www.schemalaw.com/pricing) lists the page limits. Whichever you use, compare a few identifiers in the opened file with the page image.

### Quick tests for a column of amounts

1. Every amount should have the same number of decimal places as its neighbors.
2. Commas should sit every three digits, counting from the decimal point.
3. No amount should be wildly larger or smaller than the rest of its column without a reason on the page.
4. The count of negative entries should match the count you see on the image.

## How do misread dates happen, and which ones matter?

Misread dates happen in three ways: a digit inside the date is swapped, a separator is read as a digit, or a month abbreviation is confused with another. The result is nearly always another valid date. The ones that matter are the dates you will count from or rely on to put events in order.

### How a date goes wrong

| On the page | In the output | What happened |
| --- | --- | --- |
| 03/15/2019 | 08/15/2019 | 3 read as 8, giving a real date five months off |
| 3/15/2019 | 311512019 | Both slashes read as 1 |
| 11/07/2013 | 11/01/2018 | Two swaps in one date |
| Jan. 4 | Jun. 4 | "a" read as "u" in small type |
| Mar 12 | May 12 | "r" read as "y" on a faint copy |
| June 1st | June 1 st or June 15t | Raised ordinal split off or read as a digit |
| Rubber-stamped "RECEIVED MAY 02 2022" | Nothing, or fragments | Stamp faint, tilted or over other text |

A date that becomes impossible, such as a thirteenth month or a 41st day, is the lucky case, because it can be found by sorting or filtering. Most misread dates are plausible, and plausible errors are only found by comparison.

### Which dates to verify every time

Verify against the image any date you will enter in a calendar, a chronology, a calculation of interest or a statement to a court or another party. In practice that means dates of service, filing and receipt, dates of notices, dates of loss or injury, signature dates, and the start and end of any period. How a deadline is computed from such a date is a legal question that depends on the rules of your jurisdiction. The point for document handling is narrower: do not let the starting date be one a machine read and nobody checked.

### Ways to catch a wrong date

- **Use the sequence.** Entries in a ledger, a docket or a set of medical visits run in order. A date that jumps backward or forward and then returns is suspect.
- **Use the weekday.** If the document prints "Tuesday, March 15", check that the date fell on a Tuesday.
- **Use the repeat.** Letters carry a date at the top and often again in the text or the fax header. Forms repeat dates beside signatures.
- **Use the span.** If a statement covers "03/01 through 03/31", no transaction on it can be dated in August.

Dates written only in digits carry one more risk, and it has nothing to do with recognition. In much of the world the day comes before the month, so 03/04 on a foreign record may be the third of April. The post on [OCR for foreign language documents](https://www.schemalaw.com/blog/ocr-foreign-language-documents) explains how to settle which order a document uses.

## Account, case and identification numbers with no room for error

Identifiers are the hardest numbers to check, because no arithmetic applies to them and every character counts. One wrong digit in an account number points to a different account. Verify each identifier you rely on by counting its characters, knowing its format, and reading it against the image one character at a time.

### Count first

Before reading an identifier, count it. A Social Security number has nine digits. A given bank's account numbers, a court's case numbers and an insurer's claim numbers each have a set length and pattern. A converted value that is one character short or long is wrong, and you know that before comparing a single digit.

### Learn the format

Many identifiers reserve certain positions for letters and others for digits, and some exclude confusing characters by design. The vehicle identification number is a useful example because its rules are published. Under [49 CFR 565.13](https://www.law.cornell.edu/cfr/text/49/565.13), a VIN consists of seventeen characters, and the permitted set of letters leaves out I, O and Q. So if converted text shows a VIN containing the letter O, the software has misread a zero, and you know which character to fix.

The same regulations build in a self-test. [49 CFR 565.15](https://www.law.cornell.edu/cfr/text/49/565.15) makes position nine a check digit, there to provide a means for "verifying the accuracy of any VIN transcription", and sets out the calculation. A VIN whose check digit does not agree with its other sixteen characters has been miscopied somewhere.

Other identifiers have formats of their own, and some have check digits. Look for the issuing body's published description before you lean on a pattern, and do not assume one court's case number format is another's.

### Read it properly

1. **Zoom the image** until the identifier fills a good part of the screen.
2. **Break it into groups of three or four** and compare group by group.
3. **Read it backward once.** Going from the last character to the first stops your mind from supplying what it expects.
4. **Compare every occurrence.** An account number printed on each page of a statement gives you several readings. If they disagree, the image decides, not the majority.
5. **Copy, do not retype.** Once a value is verified, copy and paste it wherever it is needed. Retyping adds human errors to machine ones.

Take a collision report in a fictional matter, Abara v. Kestrel Freight. The converted text gives the truck's VIN as seventeen characters, one of them the letter O, in a position between two digits. The format rule alone flags it. On the image the character is narrower than the O in "FORD" on the same line, and it is a zero.

Identifiers typed or written into boxes bring layout problems as well, covered in the post on [OCR for scanned forms](https://www.schemalaw.com/blog/ocr-scanned-forms). Page identifiers stamped on a production are their own subject, in the guide on [how to OCR Bates numbered documents](https://www.schemalaw.com/blog/how-to-ocr-bates-numbered-documents).

## Arithmetic and cross-checks that catch a wrong digit

Arithmetic catches a wrong digit whenever the document states a figure that can be recomputed from others: a total, a subtotal, a running balance, a percentage. Put the converted figures in a spreadsheet, recompute, and compare with what the page prints. Where they disagree, the size of the difference points to the error.

### A worked example

A fictional checking statement for a client, Delphine Okoro, converts to this table. The last column is added by you: the previous balance plus deposits minus withdrawals.

| Date | Description | Withdrawal | Deposit | Balance as read | Balance recomputed |
| --- | --- | --- | --- | --- | --- |
| 04/01 | Opening balance | | | 2,410.18 | |
| 04/03 | Check 1184 | 635.00 | | 1,775.18 | 1,775.18 |
| 04/09 | Payroll deposit | | 1,902.44 | 3,677.62 | 3,677.62 |
| 04/12 | Rent | 1,480.00 | | 2,247.62 | 2,197.62 |
| 04/20 | Utility | 96.31 | | 2,151.31 | 2,151.31 |

The recomputed balance on 04/12 is 50.00 lower than the balance as read, and the next row agrees again. Because the following row recomputes correctly from the balance as read, that balance is right and the withdrawal is wrong. A difference of exactly 50 in the tens place suggests 3 read as 8: the rent on the page is 1,430.00.

### What the difference tells you

| Difference between printed and recomputed | Likely cause |
| --- | --- |
| 5, 50, 500 | 3 and 8 swapped, or 1 and 6, in one place |
| 2, 20, 200 | 6 and 8 swapped, or 5 and 3, or 7 and 9 |
| 6, 60, 600 | 1 and 7 swapped |
| Equals one whole line item | A row skipped or read twice |
| Twice one line item | A sign lost, so a withdrawal was treated as a deposit |
| About 99 percent of one figure, or 99 times it | A decimal point dropped or added |
| Divisible by 9 | Two digits transposed, usually by a person retyping |

### Checks beyond adding up

- **Words against figures.** "Ten Thousand Dollars ($10,000.00)" states the amount twice. Compare them.
- **Summary against detail.** The total on a cover page should equal the sum of the schedule behind it.
- **Sequences.** Check numbers, invoice numbers and page numbers rise in order. A break marks a misread or a missing item.
- **Rates.** Where a page gives a rate, a base and a result, multiply.
- **Counts.** "Page 3 of 12" and "14 items" tell you how many of something to expect.

### What arithmetic will not catch

Two errors can cancel. A printed total can itself be misread to match a wrong column. Figures that belong to no sum, such as identifiers and stand-alone dates, get no help at all. So arithmetic narrows the search and does not replace the read against the image for the figures you will rely on. The guide on [converting a scanned PDF to Excel](https://www.schemalaw.com/blog/scanned-pdf-to-excel) covers getting tables into a spreadsheet in the first place, and the section on [proofreading OCR output against the original](https://www.schemalaw.com/blog/why-is-ocr-output-full-of-errors#proofreading-ocr-output-against-the-original) gives the full routine. Whatever you find, note which figures were verified and by whom, so the next reader knows which numbers have been checked and which have only been read by a machine.

## Try it on a real document

Upload a scanned PDF and export it as Word, a searchable PDF or plain text on the free plan. Your documents are never used to train an AI model. [Start free](https://www.schemalaw.com/api/auth/google)
