Log Loss / Cross-Entropy Calculator
Binary cross-entropy for predicted probabilities vs true labels — the loss that punishes confident wrong answers.
ln(2) ≈ 0.693 is the loss of always predicting 0.5 — the random baseline. Log loss rewards calibrated confidence: being 90% sure and right beats 60% sure and right, but being 99% sure and WRONG is catastrophic.
Formula
About Log Loss / Cross-Entropy Calculator
Log loss (binary cross-entropy) is the loss most classifiers actually train on, and it measures something accuracy can't: the quality of your probability estimates. It rewards being confidently right and brutally punishes being confidently wrong — a single prediction of 0.001 for a true positive can dominate the entire dataset's loss. This calculator computes mean log loss from your predicted probabilities and true labels, flags the random baseline (ln 2 ≈ 0.693), and surfaces the worst single-sample contribution so you can spot the overconfident mistakes that are wrecking your score.
How to use Log Loss / Cross-Entropy Calculator
- 1Enter your values into Log Loss / Cross-Entropy Calculator — sensible, domain-typical defaults are pre-filled so you see a real result immediately.
- 2The result recomputes live using the formula shown on the page; there is no button to press.
- 3Adjust any input to compare scenarios, then read the worked example to see the substituted numbers.
Why use Log Loss / Cross-Entropy Calculator?
- ✓Computes Log Loss / Cross-Entropy instantly in your browser — no sign-up, no upload, no server round-trip.
- ✓100% free and unlimited, with the exact formula shown: log loss = −(1/N) Σ [yᵢ.
- ✓Runs entirely client-side, so every value you enter stays private on your device.
- ✓Live recompute as you type, with a worked example and authoritative references for trust.
Frequently asked questions
Why does log loss punish confident wrong predictions so harshly?+
Because −ln(p) → ∞ as p → 0. If you predict probability 0.001 for an outcome that happens, the loss is ~6.9 — versus ~0.7 for a hedged 0.5. This is by design: it forces models to be honestly uncertain. Overconfidence is the cardinal sin log loss exists to penalize.
What's a good log loss value?+
It's dataset-dependent, but anchors help: ln(2) ≈ 0.693 is the always-0.5 baseline, so anything below that beats random. Below ~0.5 is decent, below ~0.2 is strong. Compare to the loss of predicting the class base rate for every sample — that's the 'no skill' floor for your specific class balance.
Log loss vs accuracy — why use both?+
Accuracy only cares whether argmax is right; log loss cares how confident you were. A model can have high accuracy but terrible log loss if it's wildly overconfident on its few mistakes. If downstream decisions use the probabilities (not just the label), log loss is the metric that matters.
How do I avoid the infinite loss problem?+
Clip predicted probabilities away from exactly 0 and 1 (this tool clips to 1e-15), which every library does. Better: improve calibration via temperature scaling or Platt scaling, or use label smoothing during training, so the model stops emitting near-certain probabilities it can't back up.
Related tools
- Precision@K & Recall@K Calculator
- Mean Reciprocal Rank (MRR) Calculator
- NDCG Calculator
- Mean Average Precision (MAP) Calculator
- Cosine Similarity Calculator
- Vector Distance Calculator (Euclidean, Manhattan, Chebyshev, Minkowski)
- Spam Filter — Confusion Matrix & Metrics Calculator
- Medical Diagnostic Test — Confusion Matrix & Metrics Calculator
Related ML & AI tools
ROC-AUC Calculator (from TPR/FPR points)
Trapezoidal area under the ROC curve from your (FPR, TPR) operating points — the threshold-independent ranking score.
● LiveClassification Threshold Cost Calculator
Find the probability cutoff that minimizes expected cost given your false-positive and false-negative penalties.
● LiveSilhouette Score Calculator
Cluster cohesion vs separation for one point — the building block of the silhouette metric for choosing K.
● Live