# Bayesian t test and Bayes factor calculator

> Paste two groups or paired data and get the Bayes factor BF10 (JZS prior, as JASP), evidence wording, effect size posterior and robustness plot. Free.

URL: https://www.labcanvas.com/tools/bayesian-t-test-calculator

Paste two columns (two independent groups, or the same subjects measured twice) and the calculator gives the Bayes factor BF₁₀ of a Bayesian t test with the default JZS prior (a Cauchy prior on the effect size δ with width r = √2/2, as in JASP and the BayesFactor R package), says how strong the evidence is (anecdotal, moderate, strong, very strong, extreme), and shows the posterior of δ with its 95% credible interval and a robustness plot of BF₁₀ against the prior width. BF₁₀ = 17 means the data are 17 times more likely if there is a difference than if there is none.

## Quick answer

- **What it does:** Computes the JZS Bayes factor BF₁₀ for two independent groups, paired data or one group against a value, with the posterior of the effect size δ and a robustness check across prior widths.
- **Formula:** BF₁₀ = p(data | H₁) / p(data | H₀), with H₀: δ = 0 and H₁: δ ~ Cauchy(0, r), r = √2/2; δ = mean difference / SD (Rouder et al. 2009).
- **Example:** Student’s sleep data (10 patients, two drugs, paired): t(9) = 4.06, BF₁₀ = 17.26, strong evidence for a difference; posterior median δ = 1.08 (95% credible interval 0.28 to 1.98).

Free, in the browser, no account needed. Updated 2026-11-17.

## Features

- Paired, independent-samples and one-sample Bayesian t tests
- Default JZS prior (Cauchy, r = √2/2) as in JASP and BayesFactor; wide (1), ultrawide (√2) or any width
- Two-sided or one-sided alternatives (δ > 0 or δ < 0)
- BF₁₀ and BF₀₁ with Jeffreys’ evidence categories and a plain-English sentence
- Posterior of the effect size δ: median, 95% credible interval, P(δ > 0)
- Prior and posterior plot, and a robustness plot of BF₁₀ against the prior width
- The classical t test and P value on the same data, for comparison
- Opens in the LabCanvas Graph app with the same analysis and plots; PNG at 300 or 600 dpi; nothing is uploaded

## How to use it

1. **Paste your values**: One column per group with the names in the first row; for paired data, one row per subject in the same order in both columns.
2. **Choose the design**: Paired (the same subjects twice), two independent groups, or one group against a test value. The prior and a one-sided test are under More options.
3. **Read the Bayes factor**: BF₁₀ above 1 favours a difference, below 1 favours no difference; the wording gives the strength, the plots show the effect size and how much the prior matters.

## At a glance

| | |
| --- | --- |
| Input | Two columns (paired or independent groups) or one column and a test value |
| Prior | Cauchy on δ, width r = √2/2 (medium), 1 (wide), √2 (ultrawide) or your own |
| Output | BF₁₀, BF₀₁, evidence category, posterior median and 95% credible interval of δ, robustness plot |
| Accuracy | Matches BayesFactor’s published sleep example (17.25888) and pingouin to < 10⁻⁶ |
| Export | PNG plots at 300 or 600 dpi, CSV of results, methods sentence; the Graph app with the same analysis |

## How it works

**The test.** The Bayesian t test compares two hypotheses about the standardised effect size \(\delta\) (the difference in means divided by the SD; for paired data, the mean of the differences divided by their SD): \(H_0: \delta = 0\) and \(H_1: \delta \sim \mathrm{Cauchy}(0, r)\). This is the Jeffreys–Zellner–Siow (JZS) test of Rouder et al. (2009), the default of JASP and of `ttestBF` in the BayesFactor R package. The Bayes factor is the ratio of how well each hypothesis predicted the data:

$$\mathrm{BF}_{10} = \frac{p(\text{data} \mid H_1)}{p(\text{data} \mid H_0)}$$

It depends on the data only through the t statistic, the effective sample size \(N\) (\(n\) for paired and one-sample tests, \(n_1 n_2/(n_1 + n_2)\) for two groups) and the degrees of freedom \(\nu\):

$$\mathrm{BF}_{10} = \frac{\int_0^\infty (1 + N g r^2)^{-1/2} \left(1 + \frac{t^2}{(1 + N g r^2)\nu}\right)^{-(\nu + 1)/2} (2\pi)^{-1/2} g^{-3/2} e^{-1/(2g)} \, dg}{\left(1 + t^2/\nu\right)^{-(\nu + 1)/2}}$$

The integral is computed numerically; the posterior of \(\delta\) is the noncentral t likelihood times the Cauchy prior, normalised. One-sided tests restrict the prior to \(\delta > 0\) or \(\delta < 0\).

**The prior width.** \(r = \sqrt{2}/2 \approx 0.707\) (“medium”) says that, if there is an effect, half of the plausible effect sizes lie between −0.707 and 0.707. “Wide” is \(r = 1\) and “ultrawide” \(r = \sqrt{2}\). The robustness plot shows BF₁₀ for every width from 0 to 1.5, so a reader can see whether the conclusion depends on the choice.

**Evidence categories.** Jeffreys’ categories as adapted by Lee and Wagenmakers (2013), used by JASP: BF₁₀ 1–3 anecdotal, 3–10 moderate, 10–30 strong, 30–100 very strong, above 100 extreme evidence for H₁; the same bands of BF₀₁ = 1/BF₁₀ for H₀.

**Accuracy.** The calculation is the LabCanvas Graph app’s own Bayesian t test, run in your browser. On Student’s sleep data it gives BF₁₀ = 17.25888, the value BayesFactor publishes for `ttestBF(sleep, paired)`, and it matches pingouin’s `bayesfactor_ttest` for paired and independent designs and all three prior widths to a relative error below 10⁻⁶ (scripts/bayesian-t-test-calculator-check.ts).

Sources: Rouder JN, Speckman PL, Sun D, Morey RD, Iverson G. Bayesian t tests for accepting and rejecting the null hypothesis. *Psychon Bull Rev* 2009;16:225–237, [doi:10.3758/PBR.16.2.225](https://doi.org/10.3758/PBR.16.2.225). van Doorn J, van den Bergh D, Böhm U, et al. The JASP guidelines for conducting and reporting a Bayesian analysis. *Psychon Bull Rev* 2021;28:813–826, [doi:10.3758/s13423-020-01798-5](https://doi.org/10.3758/s13423-020-01798-5). Cushny AR, Peebles AR. The action of optical isomers: II. Hyoscines. *J Physiol* 1905;32:501–510, [doi:10.1113/jphysiol.1905.sp001093](https://doi.org/10.1113/jphysiol.1905.sp001093) (the sleep data). Lee MD, Wagenmakers EJ. *Bayesian Cognitive Modeling: A Practical Course*. Cambridge University Press; 2013.

## Worked example: two sleeping drugs in the same 10 patients

The built-in data are Student’s sleep data (Cushny and Peebles 1905): the extra hours of sleep of 10 patients on drug 1 and on drug 2, the example BayesFactor uses. Each patient took both drugs, so the test is paired.

| Quantity | Value |
| --- | --- |
| Mean of the differences (drug 2 − drug 1) | 1.58 h |
| Classical paired t test | t(9) = 4.062, P = 0.0028 |
| BF₁₀ | 17.26 (strong evidence for a difference) |
| BF₀₁ | 0.058 |
| Posterior median δ (95% credible interval) | 1.08 (0.28 to 1.98) |
| BF₁₀ with a wide (r = 1) and ultrawide (r = √2) prior | 18.42 and 18.02 |

**How to read it.** The data are 17.3 times more likely if the drugs differ than if they do not: strong evidence (10–30). The robustness check gives 17 to 18.5 for every reasonable prior width, so the conclusion does not hang on the prior. The effect is large: the posterior puts δ (the mean difference in SD units) between 0.28 and 1.98.

**The same data as independent groups.** Switch the design to two independent groups and BF₁₀ drops to 1.27 (anecdotal): ignoring the pairing throws away the fact that each patient is compared with themselves. Choose the design that matches how the data were collected.

| BF₁₀ | Evidence |
| --- | --- |
| above 100 | Extreme evidence for H₁ |
| 30 to 100 | Very strong for H₁ |
| 10 to 30 | Strong for H₁ |
| 3 to 10 | Moderate for H₁ |
| 1 to 3 | Anecdotal for H₁ |
| 1/3 to 1 | Anecdotal for H₀ |
| 1/10 to 1/3 | Moderate for H₀ |
| below 1/10 | Strong or more for H₀ |



## Questions

### What is a Bayes factor?

The ratio of how likely the data are under two hypotheses. BF₁₀ = 5 means the data are five times more likely if there is an effect than if there is none; BF₁₀ = 0.2 (BF₀₁ = 5) means five times more likely if there is none. Unlike a P value, it can show evidence for no effect.

### How do I report a Bayesian t test?

Give the design, the prior and the Bayes factor, for example: “A Bayesian paired t test with a Cauchy prior (r = 0.707) gave BF₁₀ = 17.3, strong evidence for a difference; posterior median δ = 1.08, 95% credible interval 0.28 to 1.98.” Copy methods writes this sentence for your data, and the robustness plot shows the prior did not drive it.

### Which prior width should I use?

The default r = √2/2 (medium) unless you have a reason to expect larger or smaller effects. Report the robustness check, which shows BF₁₀ for every width; if the conclusion holds across them, the choice does not matter.

### Is BF₁₀ = 3 significant?

Bayes factors have no significance threshold. Between 3 and 10 is moderate evidence; many authors want 10 or more before calling evidence strong. Report the number and its category rather than a yes or no.

### Does this give the same answer as JASP?

Yes for the default settings: it uses the same JZS prior and Cauchy width as JASP and the BayesFactor package. On Student’s sleep data it gives BF₁₀ = 17.26, as BayesFactor does.

### Can I use summary statistics instead of raw data?

This page takes the raw values. If you only have t and the sample sizes, the Bayes factor can be computed from those alone; the LabCanvas Graph app takes means, SDs and Ns in a summary table.
