Cross-Entropy Loss Calculator
Calculate binary or categorical cross-entropy loss between predicted probabilities and true labels for machine learning model evaluation.
Mode
One 1 among 0s. Values must sum to 1.
Should sum to 1.0 (softmax output).
Result
Enter values and click Calculate
Cross-Entropy Loss
—
Reference — Common Values
| Loss | Meaning |
|---|
Summary
Calculate binary or categorical cross-entropy loss between predicted probabilities and true labels for machine learning model evaluation.
How it works
- Select Binary mode for two-class problems (true label 0 or 1, predicted probability 0–1).
- Select Categorical mode for multi-class problems — enter comma-separated one-hot true labels and predicted probabilities.
- Binary formula: H = -[y × log(p) + (1-y) × log(1-p)].
- Categorical formula: H = -Σ(y_i × log(p_i)) over all classes.
- The result shows the loss value, entropy interpretation, and a reference table for context.
Use cases
- Verify that a neural network loss value matches manual calculation during debugging.
- Understand what a reported cross-entropy loss means in practice (good vs. random vs. bad).
- Teach or learn the difference between binary and categorical cross-entropy.
- Quickly check whether predicted probabilities for a single sample are reasonable.
Frequently Asked Questions
Last updated: 2026-06-11 ·
Reviewed by Nham Vu