Skip to main content

A/B Test Sample Size Calculator

Calculate the minimum number of visitors needed per variant before starting your A/B test. Input your baseline rate, target improvement, and statistical parameters to get sample size and estimated duration.

✓ Two-proportion z-test formula ✓ Configurable power & alpha ✓ Duration estimate by traffic ✓ Multi-variant support (A/B/C)

Test Parameters

Your current conversion rate (e.g., 5 for 5%)

Relative improvement to detect (e.g., 20 = detect 5% → 6%)

Duration Estimate

% of traffic included in the test

Results

MDE Sensitivity

Sample size per variant at different MDEs (same baseline/alpha/power):

Frequently Asked Questions

Why do I need to calculate sample size before running an A/B test?▼

Without a pre-determined sample size, you risk stopping the test too early (when results look significant by chance) or too late (wasting traffic). Pre-calculating sample size ensures your test has enough statistical power to reliably detect your target improvement and control your false-positive rate.

What is statistical power?▼

Statistical power (1-β) is the probability of detecting a real effect when one truly exists. An 80% power means you have an 80% chance of seeing a significant result if your variant really is better by the minimum detectable effect (MDE). Higher power requires larger samples. Most A/B tests use 80% or 90% power.

What is the Minimum Detectable Effect (MDE)?▼

MDE is the smallest relative improvement you care about detecting. If your baseline conversion rate is 5% and you want to detect a 20% relative improvement (to 6%), that's a 20% MDE. Smaller MDEs require much larger sample sizes — a 5% MDE might need 10x more traffic than a 20% MDE.

What significance level (alpha) should I use?▼

The standard is α = 0.05 (95% confidence), meaning a 5% false-positive rate. For high-stakes decisions (pricing, checkout flow), use α = 0.01. For exploratory tests where you'll validate winners anyway, α = 0.10 is acceptable. Never use α > 0.10 for production decisions.

What if I don't have enough traffic to reach the required sample?▼

Consider increasing MDE (accept only larger improvements), reducing variants (stick to A/B not A/B/C), or running the test longer. If your monthly traffic can't reach the sample within a reasonable timeframe (under 4-8 weeks), the test may not be feasible. Focus on higher-traffic pages or use Bayesian testing methods.

How do I estimate the test duration?▼

Test duration = required sample size per variant / (daily traffic × allocation percentage). If you need 5,000 visitors per variant with 1,000 daily visitors split 50/50, it takes 5,000 / 500 = 10 days. Add 10-20% buffer for weekday/weekend traffic variation.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

IP CIDR Calculator IPv4 Subnet Calculator Age Calculator LLM Context Window Calculator Kubernetes Resource Calculator Test Coverage Calculator API Rate Limit Calculator VLSM Calculator Rate Limit Calculator Kubernetes Resource Quota Calculator Semver Calculator AI Prompt Cost Calculator CSS Specificity Calculator Semantic Version Bumper Jest Testing Framework Guide AI Rate Limit Calculator LLM Prompt Caching Calculator CI/CD Pipeline Cost Estimator Blockchain Transaction Fee Calculator Image Optimizer Checklist AI Token Cost Calculator Aspect Ratio Calculator chmod Calculator Word Counter & Text Statistics LLM Cost Calculator Kubernetes Resource Estimator Prompt Token Estimator Lighthouse Score Simulator Image Aspect Ratio Calculator Vitest Guide — Vite-native Testing Cypress Frontend Testing Guide Core Web Vitals Calculator Image Compression Estimator OpenAI Token Counter LLM Prompt Cost Calculator AI Agent Memory Planner AI Agent Run Cost Tracker RAG Chunking Calculator Smart Contract Gas Estimator AWS Cost Estimator AWS Lambda Cost Calculator Web Vitals Budget Planner Bundle Size Impact Calculator Game Loop Calculator Token Context Calculator TanStack Query Config Builder Bundle Size Budget Calculator Infrastructure Cost Calculator AI Unit Test Generator — Pro Tool API Response Mock Generator HTTP API Tester CSS Unit Converter Number Base Converter Tech Salary Calculator HMAC Generator Web Vitals Scorer WCAG Contrast Checker Cron Expression Tester K8s Resource Limits Calculator LLM Token Counter k6 Load Test Script Generator Playwright E2E Test Generator Bundle Size Estimator Vector Embedding Visualizer NPM Bundle Size Estimator Cron Expression Explainer Playwright E2E Testing Guide SHA-256 File Checksum Calculator AI Pipeline DAG Builder Solana Program ID Generator Percentage Calculator Date Duration Calculator Bandwidth Calculator Kubernetes Resource Calculator Kubernetes Resource Request Calculator AI Embeddings Dimension Explorer Accessibility Color Contrast Checker Sprite Sheet Coordinate Generator LLM Benchmark Calculator Prompt Injection Tester AI Prompt Token Estimator RAG Chunking Calculator Embedding Similarity Calculator API Test Case Generator Mobile Safe Area Calculator Core Web Vitals Budget Calculator Image Optimization Calculator Password Strength Analyzer Secret Entropy Checker SQL Window Functions Builder Redis TTL Calculator

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →