Balanced Accuracy Calculator

Measure fair classification performance across imbalanced classes using confusion matrices, label lists, class metrics, adjusted scores, visual comparisons, exports, and guided explanations for decisions.

Calculation settings

Binary confusion counts

Counts are interpreted relative to the selected positive class.

Multiclass confusion matrix

Rows represent actual classes. Columns represent predicted classes.

Actual and predicted label lists

Use commas, spaces, semicolons, or one label per line. Classes are detected automatically.

Formula used

Binary balanced accuracy = (Sensitivity + Specificity) ÷ 2 Sensitivity = TP ÷ (TP + FN) Specificity = TN ÷ (TN + FP) Multiclass balanced accuracy = (Recall₁ + Recall₂ + … + Recallₖ) ÷ K Adjusted balanced accuracy = (Balanced accuracy − Chance level) ÷ (1 − Chance level)

Balanced accuracy gives every class equal influence. It is useful when class sizes differ. Ordinary accuracy can hide minority-class failures.

For multiclass tasks, calculate recall separately for each class. Then average the defined class recalls. The calculator also shows one-versus-rest specificity.

How to use

  1. Select binary counts, a multiclass matrix, or label lists.
  2. Enter non-negative whole-number counts or matching label sequences.
  3. Choose zero-division, precision, format, and detail settings.
  4. Press the calculation button and review warnings.
  5. Compare balanced accuracy against standard and baseline accuracy.
  6. Copy, export, or print the completed report.

Example data

ExampleInputLearning point
Balanced binaryTP 45, TN 45, FP 5, FN 5Accuracy and balanced accuracy are equal.
Imbalanced binaryTP 42, TN 810, FP 90, FN 8Balanced accuracy reveals both class recalls.
Three classes38,2,0 / 5,29,6 / 1,4,15Each class contributes one recall value.
Majority predictionTP 0, TN 900, FP 0, FN 100High accuracy can coexist with poor balance.

Understanding the result

A score near one indicates strong recall across classes. A score near the class-count baseline suggests random performance. Scores below baseline may reveal reversed predictions.

Thresholds are guidance rather than universal rules. Medical, fraud, and safety applications need stricter review. Always inspect per-class recall and error costs.

Frequently asked questions

Why use balanced accuracy?

It prevents large classes from dominating the headline score. Every class recall contributes equally.

Is balanced accuracy the same as accuracy?

No. Accuracy counts all correct predictions together. Balanced accuracy averages class-level recall.

What is balanced accuracy for binary classification?

It is the average of sensitivity and specificity. Both classes receive equal weight.

How is multiclass balanced accuracy calculated?

Calculate recall for every class, then average those recalls. Undefined classes follow the selected policy.

What does adjusted balanced accuracy mean?

It removes the expected chance baseline. Zero then represents chance-level performance.

Can balanced accuracy be negative?

Raw balanced accuracy is normally between zero and one. Its adjusted version can become negative.

What happens when a class has no samples?

Its recall is undefined. Choose whether to display, replace, ignore, or stop.

Should specificity be averaged for multiclass models?

Specificity can provide additional insight. Standard multiclass balanced accuracy primarily averages recall.

Which other metrics should I inspect?

Review precision, F1, MCC, confusion counts, class support, and application-specific error costs.

Related Calculators

Confusion Matrix CalculatorClassification Accuracy CalculatorRecall CalculatorSpecificity CalculatorSensitivity CalculatorFalse Positive Rate CalculatorFalse Negative Rate CalculatorMatthews Correlation Coefficient CalculatorLog Loss CalculatorBinary Cross-Entropy Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.