Skip to main content

Mobile A/B Test Calculator: Sample Size & Statistical Significance

Plan mobile A/B tests correctly: calculate required sample sizes, understand statistical significance at 95% confidence, set realistic MDE targets, and integrate Firebase A/B Testing or Optimizely with your React Native app.

✓ Sample size calculation ✓ Statistical significance explained ✓ Firebase A/B Testing setup ✓ Minimum Detectable Effect guide

Sample Size Reference Table

Required sample size per variant (95% confidence, 80% power) at different baseline conversion rates and MDE values:

Baseline CR MDE 5% MDE 10% MDE 20% MDE 30%
1% 312,000 79,000 20,000 9,000
3% 104,000 26,000 6,500 2,900
5% 62,000 15,600 3,900 1,740
10% 30,000 7,500 1,880 840
20% 13,000 3,300 830 370

Firebase A/B Testing Setup for React Native

npm install @react-native-firebase/app @react-native-firebase/remote-config @react-native-firebase/analytics
// hooks/useExperiment.ts
import remoteConfig from '@react-native-firebase/remote-config';
import analytics from '@react-native-firebase/analytics';

export function useExperiment(experimentKey: string, defaultValue: string) {
  const [variant, setVariant] = useState(defaultValue);

  useEffect(() => {
    // Fetch remote config values (Firebase assigns user to variant)
    remoteConfig()
      .setConfigSettings({ minimumFetchIntervalMillis: 300000 })
      .then(() => remoteConfig().fetchAndActivate())
      .then(() => {
        const value = remoteConfig().getString(experimentKey);
        setVariant(value || defaultValue);

        // Log exposure event so Firebase knows this user saw the experiment
        analytics().logEvent('experiment_exposure', {
          experiment_key: experimentKey,
          variant: value,
        });
      });
  }, [experimentKey]);

  return variant;
}

// Usage in a component
const CheckoutScreen = () => {
  const ctaVariant = useExperiment('checkout_cta_text', 'Buy Now');

  const handlePurchase = async () => {
    // Log the goal event — Firebase A/B Testing tracks this
    await analytics().logEvent('purchase', { value: 29.99, currency: 'USD' });
  };

  return (
    <Button title={ctaVariant} onPress={handlePurchase} />
  );
};

Lift Calculation Formula

Calculate relative lift and whether your result is practically significant:

// Calculate statistical significance manually
function calculateSignificance(
  controlUsers: number,
  controlConversions: number,
  variantUsers: number,
  variantConversions: number
) {
  const controlRate = controlConversions / controlUsers;
  const variantRate = variantConversions / variantUsers;

  const relativeLift = ((variantRate - controlRate) / controlRate) * 100;

  const pooledRate = (controlConversions + variantConversions) / (controlUsers + variantUsers);
  const standardError = Math.sqrt(
    pooledRate * (1 - pooledRate) * (1 / controlUsers + 1 / variantUsers)
  );

  const zScore = (variantRate - controlRate) / standardError;
  const pValue = 2 * (1 - normalCDF(Math.abs(zScore)));

  return {
    controlRate: (controlRate * 100).toFixed(2) + '%',
    variantRate: (variantRate * 100).toFixed(2) + '%',
    relativeLift: relativeLift.toFixed(1) + '%',
    zScore: zScore.toFixed(2),
    pValue: pValue.toFixed(4),
    significant: pValue < 0.05,
  };
}

Frequently Asked Questions

Why do mobile A/B tests need larger sample sizes than web tests?▼

Mobile apps have lower session frequencies than websites — users may open an app once a day or less, versus web users who might visit multiple times per day. This means it takes longer to accumulate the same number of sessions. Additionally, mobile conversion funnels are often longer and conversion rates lower (especially for in-app purchases), which requires more samples to detect meaningful differences. A typical mobile A/B test needs 2–4 weeks to reach significance, versus hours or days for high-traffic web pages.

What is statistical significance and what confidence level should I use?▼

Statistical significance means the observed difference is unlikely to be due to random chance. At 95% confidence (the industry standard), there's only a 5% probability the result is a false positive. For low-stakes UI tests (button color, copy changes), 90% confidence is acceptable. For major feature rollouts or monetization changes, use 95% or even 99%. Higher confidence requires larger sample sizes.

How do I calculate the required sample size before starting a test?▼

You need three inputs: baseline conversion rate (current CR%), minimum detectable effect (the smallest lift worth detecting — e.g., 10% relative improvement), and your desired confidence level (usually 95%). A common formula for equal groups: n = (z_alpha/2 + z_beta)^2 * (p1*(1-p1) + p2*(1-p2)) / (p1-p2)^2. Use a sample size calculator or Firebase A/B Testing's built-in sample size planner rather than computing this manually.

What is Minimum Detectable Effect (MDE)?▼

MDE is the smallest relative improvement you care about detecting reliably. If your baseline conversion is 5% and you set MDE to 20%, you're looking for a lift from 5% to 6%. Setting a smaller MDE (e.g., 5%) means you need a much larger sample to detect it reliably. Be realistic — chasing 2% lifts requires enormous traffic and long test durations. For mobile apps, an MDE of 10–20% is typically the practical minimum.

What is Firebase A/B Testing and how does it work?▼

Firebase A/B Testing (part of Firebase Remote Config) lets you run experiments that control app behavior through remote configuration values. Define variants with different Remote Config parameter values, specify your target audience (all users, specific segments), and set a goal metric (retention, revenue, in-app events). Firebase assigns users to variants client-side, collects event data via Google Analytics for Firebase, and shows results with statistical significance indicators.

Should I test multiple variants simultaneously?▼

Testing more than 2 variants (A/B/C/D tests) requires adjusting for multiple comparisons (the Bonferroni correction or similar). Each additional variant increases the chance of at least one false positive. For mobile apps where sample sizes are already constrained, limit tests to 2–3 variants maximum. Running too many variants dilutes the traffic per variant, extending test duration significantly.

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

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 →