Back to Blog
Guides

Bonferroni Correction for A/B Tests: When You Need It, and When Holm or Benjamini-Hochberg Is Better

Read five metrics on one A/B test at a 5% threshold and the chance that at least one wins by luck alone is about 23% if the metrics are independent. Bonferroni, Holm and Benjamini-Hochberg each fix that in a different way, and the choice decides how many of your wins survive.

The Bonferroni correction for A/B tests with many metrics, a worked example with five metrics, Holm and Benjamini-Hochberg compared, and the SQL to run them.

István Mészáros
István Mészáros

Co-founder & CEO

November 24, 2026
12 min read
Bonferroni Correction for A/B Tests: When You Need It, and When Holm or Benjamini-Hochberg Is Better

TL;DR

The Bonferroni correction divides the significance level by the number of comparisons (or multiplies each p-value by it), so the chance of any false positive across all of them stays at or below α. Holm gives the same guarantee with more power: it never finds fewer wins than Bonferroni. Benjamini-Hochberg controls a different error, the share of false positives among the results you call significant. Use Holm when a decision rides on any one metric or variant winning, Benjamini-Hochberg when you are screening many metrics or segments for leads, and plain Bonferroni when you need simple simultaneous intervals.

The Bonferroni correction limits false positives when you run several significance tests at once: divide the significance level α by the number of tests m (or multiply each p-value by m) and call a result significant only if it clears that stricter bar. The chance of any false positive then stays at or below α.

In an A/B test, the several tests are the metrics you read and the variants you compare with control. This guide shows why they need a correction, works through one test with five metrics under Bonferroni, Holm and Benjamini-Hochberg, gives a rule for when to use each, and ends with the SQL to compute all three on your warehouse.

Why reading many metrics needs a correction?

A significance level of α = 0.05 means that when a change does nothing, a single test still calls it significant 5% of the time. That is a type I error, and 5% is acceptable for one test. Read five metrics and each one gets its own 5% chance. If the change does nothing and the metrics were independent, the chance that at least one of them comes out significant is 1 − 0.95m:

Comparisons (m)Chance of at least one false positive at α = 0.05
15%
523%
1040%
2064%

That probability is the family-wise error rate (FWER): the chance of one or more false positives across a family of tests. Metrics in an A/B test are usually correlated (a user who adds to cart is more likely to check out), so the real rate sits below the table, though above 5% unless the metrics move in near lockstep.

The family is every comparison you would act on. A test with three treatments against one control, read on four metrics, is 3 × 4 = 12 comparisons. Breakdowns by country or platform add more. Peeking at the same test every day is a multiple-testing problem too, but a different one: corrections across metrics do not fix it; running to the planned sample size does.

How the Bonferroni correction works?

With m comparisons and a target FWER of α, Bonferroni calls comparison i significant when its p-value pi ≤ α / m. The equivalent adjusted p-value, which you can compare directly with α, is:

Bonferroni threshold      p_i ≤ α / m
Bonferroni adjusted p     min(1, m × p_i)

It works because the probability that at least one of m events happens is never more than the sum of their probabilities. If each test has at most an α/m chance of a false positive, all m together have at most α. That argument needs no assumption about how the tests relate to each other, so Bonferroni does not assume independence: it holds for correlated metrics, overlapping segments and variants that share a control.

The price is power. The bound is tight only when the false positives can't happen together, and correlated metrics tend to move together, so Bonferroni is stricter than it needs to be for A/B test metrics. With five metrics, each one must clear p ≤ 0.01 instead of 0.05, and a test sized for one metric at 0.05 will miss real effects on the others. That is the sense in which Bonferroni is called conservative.

Worked example: one test, five metrics

A checkout redesign runs as a 50/50 test with 20,000 users in each variant. The team reads five metrics, each a count and share of exposed users, with a two-sided pooled two-proportion z-test at α = 0.05:

MetricControlTreatmentRelative liftRaw p-value
Checkout conversion1,000 (5.00%)1,128 (5.64%)+12.8%0.004
Added to cart6,000 (30.00%)6,234 (31.17%)+3.9%0.011
Used search4,000 (20.00%)4,191 (20.96%)+4.8%0.018
Applied a coupon1,600 (8.00%)1,718 (8.59%)+7.4%0.032
Returned within 7 days5,000 (25.00%)5,072 (25.36%)+1.4%0.407

Without a correction, four of the five metrics are significant at 0.05. Here is the same table with each correction applied, computed from the rounded p-values above. Adjusted p-values at or below 0.05 are in bold:

MetricRaw pBonferroniHolmBenjamini-Hochberg
Checkout conversion0.0040.0200.0200.020
Added to cart0.0110.0550.0440.0275
Used search0.0180.0900.0540.030
Applied a coupon0.0320.1600.0640.040
Returned within 7 days0.4071.0000.4070.407
Significant at 0.054124

Bonferroni keeps only checkout conversion. Holm also keeps added to cart. Benjamini-Hochberg keeps all four that were significant before correction. The data is the same in every column; what differs is the error each method promises to control, which the next two sections explain. If you want to check the numbers, statsmodels.stats.multitest.multipletests in Python with method="bonferroni", "holm" and "fdr_bh" returns the same adjusted p-values.

Holm: the same guarantee as Bonferroni, more wins

The Holm method (Sture Holm, 1979), also called Holm-Bonferroni, is a step-down version of Bonferroni. Only the smallest p-value has to clear α/m. Once it does, there is one fewer comparison left that could be a false positive, so the next one is held to α/(m − 1), and so on:

  1. Sort the m p-values from smallest to largest: p(1) ≤ p(2) ≤ … ≤ p(m).
  2. Compare p(k) with α / (m − k + 1), starting at k = 1.
  3. Stop at the first p-value that is above its threshold. Every comparison before it is significant; it and every comparison after it are not.

The adjusted p-value for the k-th smallest is the running maximum of (m − j + 1) × p(j) over j = 1 to k, capped at 1. The running maximum keeps the adjusted values in the same order as the raw ones.

Holm on the five metrics, α = 0.05
  1. Checkout conversion, p = 0.004

    Threshold 0.05 / 5 = 0.010. 0.004 is below it: significant. Adjusted p = 5 × 0.004 = 0.020.

  2. Added to cart, p = 0.011

    Threshold 0.05 / 4 = 0.0125. 0.011 is below it: significant. Adjusted p = 4 × 0.011 = 0.044.

  3. Used search, p = 0.018

    Threshold 0.05 / 3 ≈ 0.0167. 0.018 is above it, so Holm stops here. Adjusted p = 3 × 0.018 = 0.054.

  4. Applied a coupon and returned within 7 days

    Not significant, because the procedure stopped. Adjusted p = max(0.054, 2 × 0.032) = 0.064 and max(0.064, 1 × 0.407) = 0.407.

Bonferroni compares every p-value with 0.010, so added to cart (0.011) misses by a hair. Holm's second threshold is 0.0125, and it gets through. In general, Holm rejects everything Bonferroni rejects and sometimes more, controls the family-wise error rate at α under the same conditions (any dependence between the tests), and needs nothing extra. For deciding which comparisons are significant, there is little reason to use plain Bonferroni instead.

Bonferroni keeps one advantage: simple simultaneous confidence intervals. Compute each interval at 1 − α/m (99% for five comparisons at α = 0.05) and all of them cover their true values together with probability at least 95%. Holm has no equally simple set of simultaneous intervals. A practical choice is to compute each interval at the threshold Holm applied to that comparison (for comparisons after the stopping point, the threshold where it stopped), so an interval that excludes zero always matches a significant adjusted p-value.

Benjamini-Hochberg: controlling the false discovery rate

Bonferroni and Holm protect against even one false positive. The Benjamini-Hochberg procedure (Yoav Benjamini and Yosef Hochberg, 1995) controls a different quantity, the false discovery rate (FDR): the expected share of false positives among the comparisons you call significant, counted as zero when you call none. An FDR of 5% allows some false positives as long as, on average, they are a small share of what you report.

  1. Sort the m p-values from smallest to largest: p(1) ≤ … ≤ p(m).
  2. Find the largest k for which p(k) ≤ k × α / m.
  3. Call the comparisons with the k smallest p-values significant, including any of them that missed their own threshold.

On the five metrics the thresholds are 0.010, 0.020, 0.030, 0.040 and 0.050. The fourth p-value, 0.032, is below 0.040; the fifth, 0.407, is above 0.050. So k = 4 and the four smallest are significant. The adjusted p-values (often called q-values) are the running minimum of m × p(j) / j from the largest p-value down, capped at 1: 0.407, then 5 × 0.032 / 4 = 0.040, 5 × 0.018 / 3 = 0.030, 5 × 0.011 / 2 = 0.0275 and 5 × 0.004 / 1 = 0.020.

The FDR guarantee is proven for independent tests and for a form of positive dependence (called PRDS). Correlated A/B test metrics are usually close enough to that for the procedure to behave well, but it is not a guarantee. The Benjamini-Yekutieli variant divides α by an extra factor of 1 + 1/2 + … + 1/m and is valid under any dependence, at a cost in power.

FDR control fits screening: scanning 30 metrics or 50 segments for effects worth a follow-up test, where a few false leads are an acceptable cost of finding more real ones. It fits a ship decision less well. If the team will ship when any one of the corrected metrics wins, one false win is exactly the error to avoid, and that is what the family-wise error rate measures.

Bonferroni vs Holm vs Benjamini-Hochberg: which to use

BonferroniHolmBenjamini-Hochberg
ControlsFamily-wise error rateFamily-wise error rateFalse discovery rate
ProcedureEvery p-value against α/mStep-down: smallest against α/m, then α/(m−1), …Step-up: largest k with p(k) ≤ kα/m
Dependence between metricsAnyAnyIndependent or positively dependent
Wins in the example1 of 52 of 54 of 5
Use it whenYou need simultaneous confidence intervals or a quick sample-size estimateA decision rides on any one metric or variant winningYou are screening many metrics or segments for leads to test next

Whichever you pick, decide the family before the test starts. A practical setup for a product test:

  • One primary metric decides the test. Name it in advance. With one treatment and the primary metric alone, there is nothing to correct.
  • Correct across the comparisons you would act on. Every treatment against control on the primary metric and on each secondary metric you would act on goes into one family, with Holm.
  • Leave guardrails out of the correction. Guardrail metrics exist to catch harm, and a correction makes them slower to flag it. Judge each one against the harm you said you would accept.
  • Treat segment breakdowns as exploration. Run Benjamini-Hochberg across them if you want a ranked list of leads, and confirm anything interesting in a new test.

How to compute Holm-adjusted p-values in SQL?

If your A/B test results are computed on the warehouse, the correction belongs there too, next to the raw p-values. How to analyze A/B tests on your data warehouse walks through the query that produces a p-value per metric. The query below takes one row per comparison and returns the Bonferroni, Holm and Benjamini-Hochberg adjusted p-values side by side. The p_values CTE holds the worked example; replace it with your results table.

WITH p_values AS (
  SELECT 'checkout_redesign' AS experiment_id,
         'checkout_conversion' AS metric,
         0.004 AS p_value
  UNION ALL SELECT 'checkout_redesign', 'added_to_cart',          0.011
  UNION ALL SELECT 'checkout_redesign', 'used_search',            0.018
  UNION ALL SELECT 'checkout_redesign', 'applied_coupon',         0.032
  UNION ALL SELECT 'checkout_redesign', 'returned_within_7_days', 0.407
),

ranked AS (
  SELECT
    experiment_id,
    metric,
    p_value,
    ROW_NUMBER() OVER (
      PARTITION BY experiment_id
      ORDER BY p_value, metric
    ) AS p_rank,
    COUNT(*) OVER (PARTITION BY experiment_id) AS m
  FROM p_values
)

SELECT
  experiment_id,
  metric,
  p_value,
  ROUND(LEAST(1.0, m * p_value), 6) AS bonferroni_p,
  ROUND(MAX(LEAST(1.0, (m - p_rank + 1) * p_value)) OVER (
    PARTITION BY experiment_id
    ORDER BY p_rank
    ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
  ), 6) AS holm_p,
  ROUND(MIN(LEAST(1.0, m * p_value / p_rank)) OVER (
    PARTITION BY experiment_id
    ORDER BY p_rank
    ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
  ), 6) AS bh_q
FROM ranked
ORDER BY experiment_id, p_rank;

On the worked example, it returns:

experiment_idmetricp_valuebonferroni_pholm_pbh_q
checkout_redesigncheckout_conversion0.0040.0200.0200.020
checkout_redesignadded_to_cart0.0110.0550.0440.0275
checkout_redesignused_search0.0180.0900.0540.030
checkout_redesignapplied_coupon0.0320.1600.0640.040
checkout_redesignreturned_within_7_days0.4071.0000.4070.407

Each experiment is its own family: every window is partitioned by experiment_id, so one table can hold the results of many tests. p_rank is each comparison's position in its experiment's sorted list and m the family size. Holm's running maximum is a window from the first row to the current one; Benjamini-Hochberg's running minimum is a window from the current row to the last. Sorting by metric as well as p_value keeps the order deterministic, and tied p-values come out with the same adjusted value either way. The adjusted values are rounded to six decimals: on BigQuery the literals are FLOAT64, so without ROUND 5 × 0.011 prints as 0.05499999999999999. The table above shows them without trailing zeros.

  • Several treatments: add a variant column, keep one row per treatment and metric, and add variant to the ROW_NUMBER sort. Each row is one comparison against control.
  • Guardrails: filter them out of p_values and report their raw p-values separately.
  • Portability: the query uses only ROW_NUMBER, COUNT, MAX and MIN as window functions, LEAST and ROUND, which Snowflake, BigQuery, Databricks, Redshift and PostgreSQL all support. The UNION ALL rows in place of VALUES are for BigQuery. On PostgreSQL, ROUND(x, 6) needs a numeric, so cast a double precision p-value column to NUMERIC first.

How Mitzu applies the correction?

Mitzu is an analytics platform on your data warehouse for BI, product analytics and experiment analysis, where the data team governs the metrics and everyone uses them through dashboards, an AI agent, Slack and their own AI assistants. For experiment analysis, Mitzu reads the A/B test exposures your experimentation tool writes to the warehouse and reports each test on the same metrics your business reports. Your experimentation tool keeps assigning users.

  • Every metric gets its lift, interval and p-value. Each treatment is compared with control at 95% confidence by default (90% and 99% are the alternatives), two-sided unless you choose a one-sided test.
  • The multiple-comparison correction is Holm. It is off by default; turn it on in the experiment's Statistics settings. It then covers every treatment against control on the primary and secondary metrics as one family.
  • Corrected p-values and matching intervals. With the correction on, the p-values shown are the Holm-adjusted ones and each interval is computed at its comparison's Holm level, so an interval that excludes zero and a significant corrected p-value always agree. The results say what they were tested with, for example 95% confidence · two-sided test · Holm correction across 4 comparisons.
  • Guardrails are never corrected, so they stay as quick to flag harm as they were. See guardrail metrics for how to read them.
  • The sample plan counts the comparisons. With the correction on, the users needed per variant account for every comparison in the family, so adding a secondary metric or a treatment shows up as a larger required sample before the test starts.

Mitzu offers Holm only: there is no Bonferroni or Benjamini-Hochberg option. For an exploratory read across many metrics or segments, the SQL above runs Benjamini-Hochberg on the same warehouse data. The statistics settings and statistical methods pages in the docs cover the details. Start free on your warehouse, or book a demo to see your own tests read with the correction on.

FAQ

What is the Bonferroni correction?

The Bonferroni correction is a method for running several significance tests while keeping the chance of any false positive at or below α. With m tests, each p-value is compared with α/m instead of α. For five metrics at α = 0.05, a metric is significant only if its p-value is 0.01 or lower.

How do I calculate a Bonferroni-corrected p-value?

Multiply the raw p-value by the number of comparisons and cap the result at 1, then compare it with your original α. A raw p-value of 0.011 among five comparisons becomes 5 × 0.011 = 0.055, which is not significant at 0.05. Comparing the raw p-value with α/m (here 0.01) gives the same answer.

Is the Bonferroni correction too conservative?

Often, yes. It guarantees the family-wise error rate under any dependence, so it plans for the worst case. When metrics are positively correlated, as A/B test metrics usually are, the actual error rate is below α and real effects get missed. Holm keeps the same guarantee and never finds fewer significant results, so it is the better default.

Does the Bonferroni correction assume independence?

No. Bonferroni rests on the union bound, which holds for any dependence between the tests, and so does Holm. Benjamini-Hochberg's guarantee is proven for independent or positively dependent tests; the Benjamini-Yekutieli variant drops that requirement at a cost in power.

Should I use Bonferroni or Holm?

Holm, for deciding which results are significant. It controls the same family-wise error rate under the same conditions and rejects everything Bonferroni rejects, sometimes more. Bonferroni is still convenient for simultaneous confidence intervals, computed at 1 − α/m each, and for a quick sample-size estimate.

When should I use Bonferroni versus FDR control?

Use a family-wise method (Bonferroni or Holm) when one false positive would lead to a wrong decision, such as shipping a variant because a secondary metric won. Use false discovery rate control (Benjamini-Hochberg) when you are screening many metrics or segments and can accept a small share of false leads in exchange for finding more real effects.

Should guardrail metrics be corrected for multiple comparisons?

Usually not. A correction makes each comparison harder to call significant, which for a guardrail means slower to flag harm. Keep guardrails out of the corrected family and judge each one by whether its confidence interval stays within the harm you agreed to accept before launch.

Key Takeaways

  • Every metric and every treatment variant compared with control is a separate test. With five independent metrics at α = 0.05, the chance of at least one false win when nothing changed is 23%; with ten it is 40%.
  • Bonferroni controls the family-wise error rate (the chance of one or more false positives) under any dependence between metrics, but it is conservative when metrics are correlated, as A/B test metrics usually are.
  • Holm sorts the p-values and tests the smallest against α/m, the next against α/(m−1), and so on, stopping at the first failure. Same guarantee as Bonferroni, never fewer wins.
  • Benjamini-Hochberg controls the false discovery rate. In the worked example it keeps four of five metrics significant where Holm keeps two and Bonferroni one.
  • All three corrections take a few lines of SQL with window functions, so the corrected p-values can sit in the warehouse next to the raw results.

About the Author

István Mészáros

Co-founder & CEO

LinkedIn: https://www.linkedin.com/in/imeszaros/

Co-founder and CEO of Mitzu. Passionate about product analytics and helping companies make data-driven decisions.

Share this article

Subscribe to our newsletter

Get the latest insights on product analytics.

Ready to transform your analytics?

See how Mitzu can help you gain deeper insights from your product data.

How to get started with Mitzu

Start analyzing your product data in three simple steps

Connect your data warehouse

Securely connect Mitzu to your existing data warehouse in minutes.

Define your events

Map your product events and user properties with our intuitive interface.

Start analyzing

Create funnels, retention charts, and user journeys without writing SQL.