The formula fits on one line:

score = (correct × marks) − (wrong × marks × penaltyRatio) 

I built NegativeMarkingCalc around it, assuming it would take an afternoon. The formula did. The edge cases around it took much longer. Here are four that are worth knowing if you ever build a scoring or grading tool.

1. Floating point and 1/3 penalties

Many exams deduct one third of a question's marks for a wrong answer. Take +2 per question:

const deduction = 2 * (1 / 3); // 0.6666666666666666 

If you round each deduction to two decimals (0.67) and multiply by three wrong answers, you get 2.01 instead of 2. Over a whole paper, that drift is visible and makes your result disagree with a hand calculation.

The fix is to never round until the final display:

function score({ correct, wrong, marks, ratio }) { const raw = correct * marks - wrong * marks * ratio; return raw; // round only when rendering } const fmt = (n) => Math.round(n * 100) / 100; 

The site also lets users choose between the exact fraction and the rounded 0.33, because some people want to match a coaching institute's answer key that used 0.33. See the 1/3 calculator for how that looks to users.

2. Skipped questions should be derived, not entered

My first version had three inputs: correct, wrong and skipped. Users constantly made them not add up to the total.

The better design is to ask for total, correct and wrong, and compute the rest:

function validate({ total, correct, wrong }) { if (correct < 0 || wrong < 0) return { ok: false, error: "No negatives" }; if (correct + wrong > total) { return { ok: false, error: "Correct + wrong exceeds total" }; } return { ok: true, skipped: total - correct - wrong }; } 

One fewer field means one fewer way to enter inconsistent data. The full calculator also handles marks for unattempted questions, which a few exams use.

3. Don't clamp negative scores to zero

It's tempting to write Math.max(0, score) so the UI never shows a negative number. But some exams do allow negative totals, and others don't say. Clamping silently hides real information from the user.

// Don't do this by default const shown = Math.max(0, score); // Do this: show the real result, clamp only if the user opts in const shown = clampToZero ? Math.max(0, score) : score; 

A student who scores −12 learns something important about their guessing strategy that a "0" would hide.

4. The break-even point is the most useful number, and few tools show it

A calculator tells you what happened. Students usually need to know what to do next. The most useful derived number is the break-even accuracy: the chance of being right at which guessing stops losing marks on average.

With penalty ratio r:

const breakEven = (r) => r / (1 + r); breakEven(1 / 4); // 0.2 -> 20% breakEven(1 / 3); // 0.25 -> 25% breakEven(1 / 2); // 0.333 -> 33.3% 

Expected value of a guess with n options, k of them eliminated:

function expectedMarks({ n, k, marks, ratio }) { const p = 1 / (n - k); return p * marks - (1 - p) * marks * ratio; } expectedMarks({ n: 4, k: 0, marks: 4, ratio: 1 / 4 }); // 0.75 ... wait 

Check that one by hand: p = 0.25, so 0.25 × 4 − 0.75 × 4 × 0.25 = 1 − 0.75 = 0.25. A blind guess on a four-option question with a 1/4 penalty is slightly positive, which surprises most people. With two options eliminated, p = 0.5 and the expected value jumps to 1.5.

I turned this into a separate tool, the guessing probability calculator, plus a target score calculator and an attempt strategy simulator that compares scenarios like attempting 70 versus 85 questions.

Bonus: presets are a trust problem, not a data problem

Adding exam presets (UPSC, NEET, SSC and others) sounds like a simple lookup table. The harder question is how confident you are in each row. Marking schemes change between years, and I can't verify every one against an official notice.

So every preset page is labeled either verified or unverified example, and the unverified ones are fully editable. For example, NEET and UPSC are marked verified, while MPSC and RRB are marked as examples. If your tool's output affects someone's decisions, showing how much to trust it is a feature.
Privacy by default

Everything runs in the browser. Saved history stays in the user's own browser storage, and the site says it's lost if they clear it. For a tool where students enter exam results, no server round trip was needed, so I didn't add one.

What I'd do differently

  • Write the unit tests for rounding and clamping first.
  • Treat "derived fields" (like skipped) as a design rule across the whole UI.
  • Add the break-even number to the main calculator earlier. Users asked for it more than any other feature.

If you've built grading, scoring or estimation tools, which edge cases bit you? I'd like to hear them in the comments.

Try it:negativemarkingcalc.com · All guides · All calculators