Schema LawSign in with Google

Best Font for OCR: Typefaces That Scan and Read Cleanly

By Schema LawPublished Updated

The best font for OCR is a plain, upright typeface with clearly different shapes for look-alike characters, even strokes and open spacing, printed dark at a normal size. For documents your office prints and later scans, the typeface matters most in small print and in identifiers such as account numbers.

For a law office the question has to be turned round. You did not choose the type on the scan in front of you. What you can choose is the type on the letters, forms and agreements your own office prints, some of which will come back years later as somebody's scan.

What is the best font for OCR?

The best font for OCR, among ordinary office typefaces, is whichever one keeps similar characters visibly apart after a page has been printed, copied and scanned. That is a property of letter shapes and spacing, and you can test it on your own printer in a few minutes. It is not a property of a famous font name.

Three points keep the question in proportion.

  • Recognition software is built for ordinary type. Reading common book and office typefaces is its everyday work, and this post makes no claim that one mainstream body font is read better than another.
  • The typeface matters at the margins. Look for its effect in small sizes, in strings with no context such as account numbers, and after a page has been through a fax or several generations of photocopying.
  • Unusual type is a known exception. ABBYY's user guide for FineReader PDF has a page headed "If your printed document contains non-standard fonts", which says that for "decorative fonts or special characters (e.g. mathematical symbols)" the company recommends a training mode, and that training is "not advisable" in other cases. That is ABBYY's guidance on non-standard fonts for its own product, and it shows where a vendor expects ordinary recognition to need help.

So the useful answer is a set of features to look for and a way to check them. No accuracy figures appear in this post, because none could be honest: results depend on the software, the printer, the paper and the scan.

How software turns a shape into a letter in the first place is covered in the post on how OCR works, under how software decides which letter a shape is.

OCR-A and OCR-B: the typefaces designed for machines to read

OCR-A and OCR-B are typefaces whose character shapes were fixed in published standards for optical character recognition. The standards say so in their titles. They are the only two faces in this post that were specified for a machine reader first and a human reader second.

OCR-B

OCR-B has a European standard that is free to read. Ecma International's page for ECMA-11, "Alphanumeric character set OCR-B for optical recognition", lists a third edition dated March 1976 and summarizes the standard this way: it "defines the nominal shapes of the printed images of the individual characters of the OCR-B font." The page adds that the font, "whilst primarily intended for use in Optical Character Recognition, is also highly suitable for general purposes." Ecma now classifies ECMA-11 as withdrawn, so treat it as a historical record of the design, not as a current requirement on anyone.

OCR-A

OCR-A was standardized in the United States. A list of American National Standards printed in a document that the National Institute of Standards and Technology hosts under FIPS PUB 32-1, "Character Sets for Optical Character Recognition (OCR)", includes "X3.17-1981 Character Set for Optical Character Recognition (OCR-A)" and "X3.49-1975 Character Set for Optical Character Recognition (OCR-B)". Those entries confirm the standards' numbers and titles. The current text of the OCR-A standard is sold by standards bodies and is not quoted here.

Where you meet them

Fonts named OCR-A and OCR-B are sold by type suppliers and bundled with some software. A font file with one of those names is one supplier's drawing of the standard's shapes, and nothing in this post vouches for how closely any particular file follows the standard. If one is installed on your computer, type Il1 O0 5S 8B in it and in your usual body font, and compare the two lines.

Why they are the wrong answer for a law office

It is tempting to conclude that a firm should print in OCR-B. Three reasons argue against it.

  1. They are not needed for ordinary recognition. The editions cited here date from 1975, 1976 and 1981. General recognition software reads ordinary proportional type, so a special face is not a precondition for a readable scan.
  2. Your first reader is a person. A contract or a letter is set for a client, a counterparty or a judge to read. A face specified around machine recognition was not chosen with long passages of prose in mind.
  3. Court rules may constrain the choice. Filing rules can dictate typeface and size, and they take priority over any preference about recognition.

Their real use to you is as a lesson in what to look for. The comparison line shows which characters a face keeps apart: whether the zero can be taken for a capital O, and whether the one, the capital I and the lowercase L are three shapes or one. Those are the features to look for in an everyday face.

Which features of a typeface make letters hard to tell apart?

Three features of a typeface make letters hard to tell apart: characters drawn with nearly identical shapes, letters set so close that neighbors merge, and strokes so thin that they break when copied. Each one produces its own family of errors in recognized text.

Look-alike shapes

Some typefaces draw a capital I, a lowercase L and the digit 1 as the same vertical bar. Some draw the capital O and the zero as the same oval. Where the shapes are identical on paper, no software can separate them by looking. It can only guess from context, and a case number or a parcel ID gives it no context.

Pair or groupWhat separates them in a careful typefaceWhere a mix-up hurts
I, l, 1A serif or bar on the capital I, a tail on the l, a flag on the 1Subsection labels such as (l) and (1); account numbers
O, 0A narrower zero, sometimes slashed or dottedBates prefixes, VINs, policy numbers
5, SA flat top and sharp corner on the 5Serial numbers
8, BA straight left side on the BUnit and suite numbers
2, ZA curved neck on the 2Postal codes, plate numbers
6, bA closed lower bowl sitting lower on the 6Mixed codes
c, e, oA wide opening on the c and eAny word, once the opening fills with toner
rn, mVisible space between r and nNames: "Barnes" and "Bames"
cl, dVisible space between c and l"clause" and "dause"
vv, wVisible space between the two v shapesRare in English, common in codes

Tight spacing

The last three rows are about spacing, not shape. When letters sit close together, a slightly heavy print or a slightly soft scan closes the gap, and two letters become one. Condensed and narrow faces, tight tracking, and justified text that squeezes lines to fit all push in this direction. Ligatures, where the typeface joins "fi" or "fl" into one shape, are the deliberate version of the same thing.

Thin strokes and small openings

Typefaces with strong contrast between thick and thin strokes look elegant when printed and fragile when copied. The hairlines drop out first, so an "h" loses its arch and an "e" loses its bar. At the other extreme, heavy faces with small enclosed spaces fill in, and "a", "e" and "o" turn into the same dot. A face with even, moderate strokes and generous openings survives both kinds of damage best.

Typeface is only one cause of look-alike errors. Low resolution and hard compression damage good type in the same ways, and a digit can even be replaced before recognition starts. The post on why OCR gets numbers wrong deals with digits in particular.

Serif, sans serif and monospaced type under recognition

Serif, sans serif and monospaced type can all be recognized well, and none of the three classes is best in every respect. Each has a typical strength and a typical weakness, so the class tells you which problems to check for, not which font to pick.

ClassTypical strengthTypical weaknessCheck before adopting
SerifCapital I, lowercase L and 1 tend to have different shapesThin strokes and fine serifs can break after copyingPrint, photocopy twice, and look at the hairlines
Sans serifEven stroke weight holds up when copiedI, l and 1 may be near-identical bars; O and 0 may matchType Il1 O0 and see whether you can tell them apart
MonospacedWide, even spacing keeps letters from merging; digits line up in columnsTakes more room; some faces have very light strokesPrint at the size you would really use

These are tendencies of the classes, and individual typefaces break them. Some sans serif faces draw a tailed l and a slashed zero. Some serif faces are so light that they copy badly. Judge the face, not the label.

Court rules already speak to type class

Where a document is headed for a court, the choice may not be yours. The Federal Rules of Appellate Procedure are an example. Rule 32 of the Federal Rules of Appellate Procedure, at subdivision (a)(5), provides: "Either a proportionally spaced or a monospaced face may be used." Subparagraph (A) adds: "A proportionally spaced face must include serifs, but sans-serif type may be used in headings and captions. A proportionally spaced face must be 14-point or larger." Subparagraph (B) reads: "A monospaced face may not contain more than 10 1/2 characters per inch."

That rule governs briefs in the federal courts of appeals. Other courts set their own requirements, and a court of appeals may have local rules of its own. Read the rules of the court you are filing in before settling a template, and let them win over anything in this post.

Size and the scan

Type class matters less than size once a page is scanned. A small face has few pixels in each letter, so every feature that separates one character from another shrinks to a dot or two. The post on the best dpi for OCR explains why small print needs more dots per inch.

Do italics, small caps and underlining make type harder to recognize?

Italics, small caps and underlining each change the shapes software sees, so each can raise the error rate on the words it touches. Whether it does on your documents is something to test, because recognition engines differ. The risk is concentrated in a few predictable places.

StylingWhat changes on the pageWhat to check in the recognized text
ItalicLetters slant and lean into their neighbors; some take different formsCase names, Latin phrases, emphasized words
BoldStrokes thicken and openings shrinkHeadings at small sizes; a, e and o
UnderlineA line touches or crosses the descenders of g, j, p, q and yUnderlined case names and headings; whether an underlined blank came out as text
Small capsCapital shapes at lowercase heightWhether the word came out in capitals, lowercase or mixed; defined terms
All capitalsNo ascenders or descenders to shape the wordI and L; O and 0; long capitalized clauses
StrikethroughA line runs through the middle of every letterWhether struck text was read as live text, garbled or dropped
SuperscriptVery small characters set highFootnote markers fused to the word before them
LetterspacingWide gaps between lettersWhether one word came out as separate letters

Legal writing leans on exactly these styles. Federal appellate briefs again give a concrete example. Rule 32(a)(6) says: "A brief must be set in a plain, roman style, although italics or boldface may be used for emphasis. Case names must be italicized or underlined." Where you have that choice, italics leave the letter shapes whole, while an underline draws a line through the lower parts of the letters.

Underlining has a second effect that has nothing to do with misread letters. A signature line or a fill-in blank is a row of underscores or a drawn rule. Recognition may return it as a string of underscores, as a line of hyphens, or as nothing, and a blank that was filled in by hand sits on top of it.

Print one sample pleading in the face you plan to scan, then inspect the citation, any statute section, and each party name. Thin italics inside the citation fail early, and so does a cramped statute number. A notice set in small type at the foot of the page fails for the same reason: too little ink per letter.

Special characters are a separate matter from styling. Section signs, paragraph marks and accented letters depend on how the output file encodes them as much as on the typeface, which the guide to plain text covers under text encoding and special characters in legal documents.

Choosing type for firm documents that will be printed and scanned later

For firm documents that will be printed and scanned later, choose a plain body face with distinct I, l, 1, O and 0, set it at a comfortable size with normal spacing, print it dark, and keep identifiers out of decorative or condensed type. Then confirm the choice with a print-and-scan test on your own equipment.

A ten-minute test page

Type this block into a document, once in each candidate face, at the size you would really use:

Il1 O0 5S 8B 2Z 6b rn m cl d vv w
(l) (1) (I) (i) (v) (y) § 1101(a)(15)(L)(i)
Barnes Bames Clark Dark modern modem
INV-0O8B1-5S2Z  Acct 1Il1-0O0O-8B8B
$1,250.00  $125,000  10/01/2011  (3,118.50)

Then:

  1. Print the page on the office printer.
  2. Photocopy the print, and photocopy the copy, so you have a second-generation sheet.
  3. Scan both sheets on the office copier at its usual settings.
  4. Run each scan through your OCR tool and export plain text.
  5. Compare the text with what you typed, character by character.
  6. Note which face lost the fewest characters on the second-generation sheet. That sheet is the realistic case.

Schema Law's free plan reads one document a day of up to three pages and, like every plan, exports plain text, which is enough to run two candidate faces on one sheet each. The limits of each plan are on the pricing page.

Choices by kind of document

Document your office printsWhat to do with the type
Engagement letters and correspondenceAny plain body face that passes the test page; avoid light or condensed weights
Contracts and amendmentsNormal spacing, no squeezed justification; defined terms in bold or quotation marks instead of small caps
Invoices and statementsFigures in a face with a clear 1, 6, 8 and 0; amounts in a column with space around them
Forms with reference numbersReference numbers in a larger size, in a face with a distinct zero, placed away from rules and boxes
Letterhead and footersDecorative type is fine for the logo; keep the address, telephone number and file reference in the body face
Fax cover sheetsLarger type than usual and heavier strokes, since the page will be scanned at fax resolution
Court filingsWhatever the court's rules require, first

Habits that help more than the typeface

  • Print dark. A draft or toner-save setting thins every stroke of every typeface.
  • Use black on white. Gray text and text over a tint lose contrast when scanned.
  • Leave room. Margins and line spacing keep stamps, punch holes and handwriting off the print.
  • Do not shrink to fit. Reducing a page to save a sheet reduces every letter with it.
  • Write identifiers so they survive. Where you control the format of a file or invoice number, avoid mixing O with 0 and I with 1 in the same string.

None of this helps with the scans that reach you from elsewhere, set in whatever type someone else chose. For those, the typeface is a clue to where errors will fall. If the page uses a face in which I, l and 1 look the same, check every subsection label and every identifier against the page image, and read the checks set out in the post on why OCR output is full of errors.

All posts in OCR basics