{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"proportion-z-test"},"result":{"entity_type":"calculator","id":"proportion-z-test","calculator_id":"proportion-z-test","canonical_url":"https://tttkmbb.com/statistics/proportion-z-test","name":"Two-Proportion Z-Test Calculator","title":"Two-Proportion Z-Test Calculator – Compare Two Percentages with p-Value and Confidence Interval","category":"statistics","category_name":"Statistics & Probability","tool_name":"calculate_two_proportion_z_test","featured_mcp_tool":false,"description":"Tests whether two independent proportions differ using the pooled two-proportion z-test and reports the z statistic, two- and one-sided p-values and a Wald confidence interval for the difference.","use_when":"You have successes and trials for two independent groups (conversion rates, response rates, defect rates) and want to know whether the rates differ significantly.","do_not_use_when":"Counts are very small (n·p or n·(1 − p) below 5 in a group: use Fisher's exact test), the groups are paired (McNemar's test), or there are more than two groups or categories (use chi-square-test).","inputs":[{"name":"successes_a","label":"Successes in A","type":"integer","required":true,"min":0,"description":"Number of successes (events) in group A.","example":60},{"name":"trials_a","label":"Trials in A","type":"integer","required":true,"min":1,"description":"Number of observations in group A.","example":200},{"name":"successes_b","label":"Successes in B","type":"integer","required":true,"min":0,"description":"Number of successes in group B.","example":40},{"name":"trials_b","label":"Trials in B","type":"integer","required":true,"min":1,"description":"Number of observations in group B.","example":200},{"name":"alpha","label":"Significance level (α)","type":"number","required":false,"default":0.05,"exclusive_min":0,"exclusive_max":1,"description":"Significance level as a probability (0.05 = 5 %), not a percentage. Confidence intervals and critical values use level 1 − alpha.","example":0.05}],"outputs":[{"name":"proportion_a","label":"Proportion A","type":"number","decimals":4,"description":"successes_a / trials_a."},{"name":"proportion_b","label":"Proportion B","type":"number","decimals":4,"description":"successes_b / trials_b."},{"name":"difference","label":"Difference (A − B)","type":"number","decimals":4,"description":"proportion_a − proportion_b."},{"name":"pooled_proportion","label":"Pooled proportion","type":"number","decimals":4,"description":"(successes_a + successes_b) / (trials_a + trials_b), used for the test's standard error."},{"name":"standard_error","label":"Standard error (pooled)","type":"number","decimals":4,"description":"√(p̂ (1 − p̂) (1/n_a + 1/n_b))."},{"name":"z_statistic","label":"z","type":"number","decimals":4,"description":"difference / standard_error."},{"name":"p_value_two_sided","label":"p-value (two-sided)","type":"number","decimals":6,"description":"2 × (1 − Φ(|z|))."},{"name":"p_value_one_sided","label":"p-value (one-sided)","type":"number","decimals":6,"description":"1 − Φ(|z|): for the alternative in the observed direction."},{"name":"ci_lower","label":"CI lower bound","type":"number","decimals":4,"description":"Lower limit of the 100·(1 − alpha) % Wald interval for the difference (unpooled standard error)."},{"name":"ci_upper","label":"CI upper bound","type":"number","decimals":4,"description":"Upper limit of the same interval."},{"name":"significant","label":"Significant at alpha","type":"boolean","decimals":4,"description":"true when p_value_two_sided < alpha."},{"name":"decision","label":"Decision","type":"string","decimals":4,"description":"Plain-language conclusion of the two-sided test."}],"input_schema":{"type":"object","properties":{"successes_a":{"description":"Number of successes (events) in group A.","type":"integer","minimum":0,"examples":[60]},"trials_a":{"description":"Number of observations in group A.","type":"integer","minimum":1,"examples":[200]},"successes_b":{"description":"Number of successes in group B.","type":"integer","minimum":0,"examples":[40]},"trials_b":{"description":"Number of observations in group B.","type":"integer","minimum":1,"examples":[200]},"alpha":{"description":"Significance level as a probability (0.05 = 5 %), not a percentage. Confidence intervals and critical values use level 1 − alpha.","type":"number","exclusiveMinimum":0,"exclusiveMaximum":1,"default":0.05,"examples":[0.05]}},"additionalProperties":false,"required":["successes_a","trials_a","successes_b","trials_b"]},"output_schema":{"type":"object","properties":{"proportion_a":{"description":"successes_a / trials_a.","type":"number"},"proportion_b":{"description":"successes_b / trials_b.","type":"number"},"difference":{"description":"proportion_a − proportion_b.","type":"number"},"pooled_proportion":{"description":"(successes_a + successes_b) / (trials_a + trials_b), used for the test's standard error.","type":"number"},"standard_error":{"description":"√(p̂ (1 − p̂) (1/n_a + 1/n_b)).","type":"number"},"z_statistic":{"description":"difference / standard_error.","type":"number"},"p_value_two_sided":{"description":"2 × (1 − Φ(|z|)).","type":"number"},"p_value_one_sided":{"description":"1 − Φ(|z|): for the alternative in the observed direction.","type":"number"},"ci_lower":{"description":"Lower limit of the 100·(1 − alpha) % Wald interval for the difference (unpooled standard error).","type":"number"},"ci_upper":{"description":"Upper limit of the same interval.","type":"number"},"significant":{"description":"true when p_value_two_sided < alpha.","type":"boolean"},"decision":{"description":"Plain-language conclusion of the two-sided test.","type":"string"}}},"formula":"p_a = x_a/n_a, p_b = x_b/n_b, p̂ = (x_a + x_b)/(n_a + n_b); z = (p_a − p_b) / √(p̂(1 − p̂)(1/n_a + 1/n_b)); p = 2(1 − Φ(|z|)); CI = (p_a − p_b) ± z(1 − alpha/2) × √(p_a(1 − p_a)/n_a + p_b(1 − p_b)/n_b)","method":"Normal approximation to the binomial without continuity correction (equivalent to the 2×2 chi-square test without Yates' correction: χ² = z²). The confidence interval uses the unpooled standard error, as is standard.","sources":[{"name":"Wikipedia – Z-test","url":"https://en.wikipedia.org/wiki/Z-test","type":"reference","retrieved_at":"2026-09-24"},{"name":"NIST/SEMATECH e-Handbook of Statistical Methods, 7.2.4.1 Confidence intervals for a proportion","url":"https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm","type":"government","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"60/200 (30 %) vs 40/200 (20 %)","inputs":{"successes_a":60,"trials_a":200,"successes_b":40,"trials_b":200},"expected":{"proportion_a":0.3,"proportion_b":0.2,"difference":0.1,"pooled_proportion":0.25,"standard_error":0.0433,"z_statistic":2.3094,"p_value_two_sided":0.020921,"p_value_one_sided":0.010461,"ci_lower":0.0157,"ci_upper":0.1843,"significant":true},"url":"https://tttkmbb.com/api/v1/calculate/proportion-z-test?successes_a=60&trials_a=200&successes_b=40&trials_b=200"},{"name":"20/100 vs 15/100","inputs":{"successes_a":20,"trials_a":100,"successes_b":15,"trials_b":100},"expected":{"difference":0.05,"pooled_proportion":0.175,"z_statistic":0.9305,"p_value_two_sided":0.35212,"ci_lower":-0.0551,"ci_upper":0.1551,"significant":false},"url":"https://tttkmbb.com/api/v1/calculate/proportion-z-test?successes_a=20&trials_a=100&successes_b=15&trials_b=100"}],"faq":[{"q":"Why does the test use a pooled proportion but the interval does not?","a":"Under H0 both groups share one proportion, so the test pools them for the best estimate of the null standard error; the interval describes the actual difference and therefore uses each group's own variance."},{"q":"Is this the same as an A/B test significance calculator?","a":"Yes for a two-sided test of conversion rates; z² equals the chi-square statistic of the corresponding 2×2 table without continuity correction."}],"tags":["two proportion z test","compare two proportions","difference in proportions","conversion rate significance","a/b test"],"related":[{"calculator_id":"chi-square-test","reason":"Same comparison as a 2×2 table, or more than two groups."},{"calculator_id":"margin-of-error","reason":"Confidence interval for a single proportion."},{"calculator_id":"sample-size","reason":"Sample size needed for a target margin of error."}],"links":{"html":"https://tttkmbb.com/statistics/proportion-z-test","markdown":"https://tttkmbb.com/statistics/proportion-z-test.md","json":"https://tttkmbb.com/statistics/proportion-z-test.json","api":"https://tttkmbb.com/api/v1/calculate/proportion-z-test","schema":"https://tttkmbb.com/api/v1/calculators/proportion-z-test","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:45:19Z"}