Free research tool

Cohen's kappa calculator

Paste two columns of labels, one row per item or 30-second epoch, to get Cohen's kappa, its 95% confidence interval and z test, overall agreement, a confusion matrix with per-category sensitivity, and linear or quadratic weighted kappa for ordered categories. It's built for comparing a wearable's sleep stages with polysomnography.

Updated . Free, no sign-up. Calculations run in your browser and your data is never uploaded.

1. Your labels (one row per item or epoch)

For epoch-by-epoch sleep staging, put one 30-second epoch per row: the device stage and the polysomnography stage. Pre-filled with psychiatric diagnoses of 30 patients by two raters from Fleiss (1971). Your data stays in this browser tab; nothing is uploaded.

2. Cohen's kappa

n = 30
Kappa
0.651
95% CI 0.456 to 0.847
Observed vs chance agreement
73.3% vs 23.6%
Unweighted
Test of kappa = 0
z = 7.00
p = < 0.001

Landis and Koch (1977) would label this “substantial” agreement. They called their bands arbitrary, so report the value and its interval rather than the label alone.

Confusion matrix (rows: rater_1; columns: rater_2)

1. Depression2. Personality Disorder3. Schizophrenia4. Neurosis5. OtherPPV
1. Depression7123054%
2. Personality Disorder0811080%
3. Schizophrenia00200100%
4. Neurosis00010100%
5. Other00004100%
Sensitivity100%89%40%20%100%73.3%

Sensitivity is per reference category; PPV is per device category; the corner cell is overall agreement.

3. Methods paragraph

Agreement between rater_1 and rater_2 across 30 items (5 categories: 1. Depression, 2. Personality Disorder, 3. Schizophrenia, 4. Neurosis, 5. Other) was assessed with Cohen's kappa (Cohen, 1960). Overall agreement was 73.3%. Cohen's kappa was 0.651 (95% CI 0.456 to 0.847, using the large-sample standard error of Fleiss, Cohen and Everitt, 1969; z = 7.00, p < 0.001). Analyses were run in the ChatPPG Cohen's Kappa Calculator (version 1.0; https://chatppg.com/tools/cohens-kappa-calculator).

Cite this analysis

Cite the methods papers for the statistics you report, and the tool if it helped. ChatPPG. Cohen's Kappa Calculator (version 1.0). 2026. https://chatppg.com/tools/cohens-kappa-calculator. Accessed 2026-10-18.

Preview BibTeX
@software{chatppg_cohens_kappa_calculator_2026,
  author = {{ChatPPG}},
  title = {{Cohen's Kappa Calculator}},
  year = {2026},
  version = {1.0},
  publisher = {ChatPPG},
  url = {https://chatppg.com/tools/cohens-kappa-calculator},
  urldate = {2026-10-18}
}

@article{cohen1960,
  author = {Cohen, Jacob},
  title = {{A coefficient of agreement for nominal scales}},
  journal = {Educational and Psychological Measurement},
  year = {1960},
  volume = {20},
  number = {1},
  pages = {37--46},
  doi = {10.1177/001316446002000104}
}

@article{fleiss1969,
  author = {Fleiss, Joseph L. and Cohen, Jacob and Everitt, B. S.},
  title = {{Large sample standard errors of kappa and weighted kappa}},
  journal = {Psychological Bulletin},
  year = {1969},
  volume = {72},
  number = {5},
  pages = {323--327},
  doi = {10.1037/h0028106}
}

@article{landis1977,
  author = {Landis, J. Richard and Koch, Gary G.},
  title = {{The measurement of observer agreement for categorical data}},
  journal = {Biometrics},
  year = {1977},
  volume = {33},
  number = {1},
  pages = {159--174},
  doi = {10.2307/2529310}
}

How kappa is calculated

Kappa compares the observed agreement p_o with the agreement expected by chance p_e, given how often each rater uses each category: κ = (p_o − p_e) / (1 − p_e) (Cohen, 1960). Weighted kappa gives partial credit to near misses on an ordered scale. Linear weights are 1 − |i − j|/(k − 1) and quadratic weights 1 − (i − j)²/(k − 1)² (Cohen, 1968). The confidence interval uses the large-sample standard error of Fleiss, Cohen and Everitt (1969), and the z test uses their standard error under the hypothesis that κ = 0.

Kappa for wearable sleep staging

Put one 30-second epoch per row with the device's stage and the polysomnography stage, and set the category order (for example W, N1, N2, N3, R). Sleep stages aren't a simple ordered scale, since REM doesn't sit between light and deep sleep, so unweighted kappa is the safer default. Use weights only with an order you can defend. Report the confusion matrix too: per-stage sensitivity shows where a device confuses light and deep sleep. Public datasets for this are listed in the wearable sleep-staging datasets guide, and published device results are on the sleep accuracy page.

Interpreting kappa

Landis and Koch (1977) proposed bands: below 0 poor, 0–0.20 slight, 0.21–0.40 fair, 0.41–0.60 moderate, 0.61–0.80 substantial and 0.81–1 almost perfect. They described the cut-offs as arbitrary, so report the value with its confidence interval and the confusion matrix rather than the label alone.

Validated against R and Python

Unweighted and weighted kappa, z statistics and variances match R's irr::kappa2 and psych::cohen.kappa on the Fleiss (1971) diagnosis data and the vision-grade data distributed with irr. Kappa matches scikit-learn's cohen_kappa_score for unweighted, linear and quadratic weights.

Frequently asked questions

When should I use weighted kappa?

When the categories have a natural order and a near miss is less serious than a far miss, such as a 1 to 5 rating. Linear weights penalise disagreement in proportion to the distance between categories; quadratic weights penalise far misses more (Cohen, 1968). For nominal categories use unweighted kappa.

Why can kappa be low when agreement is high?

Kappa subtracts the agreement expected by chance. When one category dominates, as N2 often does in sleep data, chance agreement is already high, so even a high percentage agreement can give a modest kappa. Report percentage agreement, kappa and the confusion matrix together.

What is a good kappa value?

Landis and Koch (1977) labelled 0.61 to 0.80 substantial and above 0.80 almost perfect, but called these cut-offs arbitrary. What counts as acceptable depends on the use.

Does the order of the two columns matter?

Not for kappa itself. It only decides which rater forms the rows of the confusion matrix and therefore which way sensitivity and PPV are read. Put the device in rows and the reference in columns.

Is my data uploaded anywhere?

No. The calculations run in your browser with JavaScript. Pasted or uploaded files are read locally and never sent to ChatPPG or anyone else, so you can use it with unpublished study data.

References

  1. Cohen J. A coefficient of agreement for nominal scales. Educational and Psychological Measurement. 1960;20(1):37-46. doi:10.1177/001316446002000104
  2. Cohen J. Weighted kappa: nominal scale agreement with provision for scaled disagreement or partial credit. Psychological Bulletin. 1968;70(4):213-220. doi:10.1037/h0026256
  3. Fleiss JL, Cohen J, Everitt BS. Large sample standard errors of kappa and weighted kappa. Psychological Bulletin. 1969;72(5):323-327. doi:10.1037/h0028106
  4. Landis JR, Koch GG. The measurement of observer agreement for categorical data. Biometrics. 1977;33(1):159-174. doi:10.2307/2529310
  5. Fleiss JL. Measuring nominal scale agreement among many raters. Psychological Bulletin. 1971;76(5):378-382. doi:10.1037/h0031619

Related

More free tools