Bubble Sheet OMR Grader
Operator: Abdulla Al Fahad. How tools are built and checked
Marking a stack of multiple-choice papers by hand is slow, and the dedicated scanners that read bubble sheets cost more than most schools will spend on one test. A phone photo or a copier scan is enough if the sheet carries marks the software can find. This tool prints such a sheet, with four black corner squares, two small orientation squares and an ID grid, then reads filled sheets, scores them against your key and tells you which bubbles it was not sure about.
A sheet holds up to 100 questions with two to five choices, a student ID of up to nine digits and optional version A and B bubbles, on US Letter or A4. Scans can be JPG, PNG, WebP, HEIC or a multi-page PDF, up to 150 sheets in a session.
PDF pages are drawn at 150 dpi and HEIC photos are converted in the tab. A sheet that cannot be read is listed with its reason beside the others, so the count of papers still adds up.
Key features
- A printable PDF with exact geometry shared between the generator and the reader, so the sheet and the scanner never disagree about where a bubble is
- Corner detection that survives rotation, even upside down, and a tilted photo whose far edge is up to about 30% narrower than the near one, using one large and three small black squares checked against two orientation squares
- Fill measured against local paper white and the black of the corner squares, so uneven light and light pencil do not move the threshold
- Each question classed as marked, blank, several marks or faint, with a confidence and a review flag
- Answer keys with several correct letters, per-question points, optional partial credit, and a separate key for version B
- Item analysis: percent correct and option counts for every question, with blank and several-mark counts
- XLSX or CSV gradebook, and an annotated PDF with green, red and dashed rings drawn on every sheet
How a sheet is read
The sheet is laid out in millimetres. Each answer column holds 25 questions at 6.2 mm pitch, bubbles are 4.2 mm across and 6 mm apart, and the ID grid has ten digit rows at 5 mm pitch. The big square is 9 mm and the other three are 6 mm, so the reader can tell the top-left corner from the others by area alone and the sheet reads correctly upside down. Two 4 mm orientation squares sit asymmetrically, one 30 mm from the big square along the top edge and one 45 mm from the bottom-right square along the bottom edge. Print at 100% with no fit-to-page, or the geometry no longer matches.
Reading maps the template onto the picture with a homography from the four corner centres, refitted by least squares with the two orientation squares; the root-mean-square misfit must stay under 1.2 mm on the page or the sheet is refused. Inside each bubble a disc of 1.35 mm radius is measured, which keeps the printed ring out of the average. Paper white is the 70th percentile of a ring around the bubble, and the black reference is the average of the three small corner squares, so a fill value runs from 0 for clean paper to 1 for solid ink.
The mark threshold is found per sheet by splitting all bubble fills into a light and a dark group and taking the middle between their means, limited to 0.20 to 0.55. A question with exactly one bubble at or above it is marked; two or more is several marks unless one is at least 1.7 times the next, which is read as an erasure. Both cases, and light marks, count in the sheet's needs-review total and CSV column.
How it works
A photo or PDF page is reduced to at most 2200 pixels on its long side and turned to grey. An adaptive threshold with a window about one sixth of the picture wide finds dark blobs, and the corner squares are picked as the combination of one large and three small blobs whose homography is convex, has a plausible tilt, predicts each blob's area from the local scale, and finds the two orientation squares where it expects them.
The stored preview of each sheet is the same picture the reading was done on, so the rings drawn for review land where the bubbles are.
Grading is recomputed whenever the key, the version or the partial-credit box changes, without rereading any picture.
In partial credit, a multi-answer question scores its points times right minus wrong over the number of correct letters, never below zero.
Common use cases
- A teacher photographs 32 quiz sheets on a desk by the window, with one corner of the lamp's glare across the sheets on the right. The corner squares and the local paper level absorb it, and the review list shows the three questions where a pencil mark was light.
- A department sets two versions of a 40-question exam. With versions turned on, the reader picks the key from the A or B bubble, and a sheet with neither bubble filled is graded with key A and its version shows as a question mark.
- A trainer needs to know why only 31% got question 17 right. The item analysis shows that 58% chose option C, so the key or the wording is the first suspect rather than the students.
- A multi-page PDF from a copier holds 60 sheets. Each page is read in turn and listed as its own row, and a page that is blank or cut off is reported with its reason instead of being skipped.
How to use this tool
- Set the number of questions, choices and ID digits, then download the sheet PDF and print it at 100%.
- Type the key, one line per question such as 3 BD 2, and add a version B key if you turned versions on.
- Drop the photos, scans or PDFs of filled sheets.
- Open each flagged sheet in the review panel, then download the gradebook or the annotated PDF.
- Read the item analysis for questions that most students missed or that drew one wrong option.
Example
Key lines 1 A, 2 C, 3 BD 2 and 4 E 1.5 for a 50-question sheet, graded for a student who marked A, B, B and left question 4 blank
Partial credit off, then onScore out of 5.5 points
Question 1 right (1), question 2 wrong (0), question 3 only half right
Partial credit off: 1 / 5.5
Partial credit on: question 3 earns 2 x (1 - 0) / 2 = 1, so 2 / 5.5 = 36.36%Tips for best results
- Mark the key lines with a points value only where it differs from 1; the default saves typing for a long test.
- Photograph from straight above so the sheet is close to a rectangle; a far edge more than about 30% narrower than the near edge is refused, and so is a sheet in which a bubble is under about 7 pixels wide at its far side.
- A dark background makes the corner squares easier to isolate than a patterned desk.
Common pitfalls
The sheet must be printed from this page at 100% with the same settings used for reading. A different question count or paper size changes the geometry and the reading will be wrong or fail.
Light pencil, partly erased marks and bubbles filled with a tick are the cases most likely to be misjudged; the page flags them but cannot make a faint mark certain.
A photo that crops out or covers a corner square, or mirrors the sheet, is rejected with the reason, and the page names the missing corner when it can; there is no guess from three corners. Because of the orientation squares, sheets printed before they were added no longer read.
Common errors and how to fix them
- Only three of the four corner squares were found
- The message names the missing corner, counted as if the sheet were upright with the large square at the top-left. Include all four black squares, flat and evenly lit; a shadow or a finger over a square hides it.
- This picture is mirrored
- The orientation squares appear on the wrong side, as in a flipped photo or the back of a sheet seen through the paper. Flip the picture back; a mirrored sheet is never read, because its ID digits would come out in the wrong order.
- The sheet is too small in this picture
- The sheet is refused when a bubble would be under about 7 pixels wide at the far side. Photograph closer, or scan at 150 dpi or more; a 150 dpi scan of the printed sheet gives bubbles about 25 pixels wide.
- Line 5 is not a question and answer
- Each key line is a number, the correct letters and optionally points, such as 5 AC 2. Lines starting with # are ignored.
Best practices
- Ask students to use a dark pencil or pen and to erase fully; a clean erasure is the main source of review flags.
- Check the flagged questions on a couple of sheets before trusting the rest of the batch.
How well it reads, and how that was measured
Reading was tested on simulated sheets, not on printed and photographed ones. A 60-question, five-choice sheet with a six-digit ID, printed from this page and rendered with known answers, was read exactly (every answer, the ID and the version) when clean at 75, 100, 150 and 300 dpi; rotated by 8, 90, 180 and 270 degrees; rotated, tilted, noisy, JPEG-compressed and uneven-light at 5, -12, 45 and 200 degrees at 75 to 150 dpi, in pen and light pencil; and with the far edge up to 30% narrower than the near edge. A mirrored sheet, a sheet with one corner square painted out and a sheet with the far edge 35% narrower were refused, each with a reason, and a page of random black squares was refused in 40 ms.
Simulation leaves out smudges, creases, glare and real pencil texture, so it does not promise the same on paper. The review flags exist because of that gap, and a few sheets from the real class are worth checking by eye first.
Frequently asked questions
How do I score a question with more than one correct answer?
List all correct letters, for example 3 BD, and the student must mark exactly those. Turn on partial credit to give points for marking some of them, with each wrong letter cancelling one right letter.
What counts as an erased answer?
When two bubbles are above the threshold but one is at least 1.7 times darker than the other, the darker one is taken as the answer and the question is flagged, because it usually means the student changed their mind.
Can I use my own sheet design?
No. The reader knows the layout this page prints; any other layout has no known bubble positions.
Why use a separate key for version B?
A version B test usually reorders the questions or the choices. The B key is applied to sheets whose version bubble reads B, and each key is checked against the question count and the number of choices.
Does the item analysis equal the reliability of the test?
No. It counts answers per question. Cronbach's alpha needs item scores of 0 and 1, and the gradebook lists the letters chosen, so score them against the key in a spreadsheet first and then use the Cronbach alpha calculator on this site.