Skip to content
FiftyCalc Free calculators for all 50 states

Accuracy Calculator

Test cases replayed : 3 of 3 match · Methodology · No outside source listed

Enter the four counts of a test or classification model to see how often it is right.

Result

Sample figures

Accuracy—

Error rate —

  • Balanced accuracy—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Accuracy Calculator

True positives (TP): enter 0 or more. Prefilled example: 85.

True negatives (TN): enter 0 or more. Prefilled example: 890.

False positives (FP): enter 0 or more. Prefilled example: 10.

False negatives (FN): enter 0 or more. Prefilled example: 15.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. True positives (TP): enter 0 or more.
  2. True negatives (TN): enter 0 or more.
  3. False positives (FP): enter 0 or more.
  4. False negatives (FN): enter 0 or more.
  5. Read the result: Accuracy; the panel also shows Error rate and Balanced accuracy.

How this calculator works

Accuracy = (TP + TN) ÷ (TP + TN + FP + FN): the share of all cases classified correctly. Error rate = 1 − accuracy.

Balanced accuracy = (sensitivity + specificity) ÷ 2, with sensitivity = TP ÷ (TP + FN) and specificity = TN ÷ (TN + FP). It is more informative than accuracy when one class is much rarer than the other.

The formula

  1. Acc=tp+tntp+tn+fp+fn×100
Symbols used in the formula
SymbolMeaningUnit
tpTrue positives (TP)
tnTrue negatives (TN)
fpFalse positives (FP)
fnFalse negatives (FN)
AccAccuracy%

Worked example

True positives (TP)85
True negatives (TN)890
False positives (FP)10
False negatives (FN)15
Error rate2.5%
Balanced accuracy91.94%
  1. Acc=85+89085+890+10+15×100=97.5

Accuracy 97.5%

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

Why can high accuracy be misleading?

With 1,000 cases and only 100 positives, a model that always says "negative" is 90% accurate but finds no positive case; its balanced accuracy is 50%.

What is the accuracy for TP 85, TN 890, FP 10, FN 15?

(85 + 890) ÷ 1,000 = 97.5%.

Questions answered

Related calculators