Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

P-Value Calculator: Z-Score to P-Value and Back

Fill in only one field, either Z (the test statistic) or one of the five probabilities. All the other values are calculated (it converts both ways, from Z to a p-value and from a p-value to Z).

Enter just one value. Enter probabilities as numbers from 0 to 1 (for example, 0.05 for 5%).
Result and graph
Enter Z (or a probability) in the fields on the left and press "Calculate". The result and a graph will appear here.

What you can do on this page

  • Enter the test statistic Z from a z-test or similar, and get the p-values for left-tailed, right-tailed and two-tailed tests in one go
  • Also work back from a p-value to Z (for example, find Z = 1.96 for a two-tailed p-value of 0.05). This is handy for finding the edge of the rejection region (the critical value)
  • The probabilities "between 0 and Z" and "between −Z and Z" are shown too, so it also works as a replacement for a standard normal table (z table)
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
This calculator finds p-values when the test statistic can be treated as following the standard normal distribution (mean 0, standard deviation 1), as in a z-test. Tests that use a different distribution, such as the t-test used for small samples, give slightly different p-values.

What is this calculation used for?

Judging whether a new drug or treatment works (medical research)

Clinical studies of a new drug use a hypothesis test to check "is the difference between the group that took the drug and the group that did not within the range of chance?", and the p-value is the evidence for that decision. For example, a test statistic of \(Z = 2.5\) gives a two-tailed p-value of about 0.012, which reads as "if the drug had no effect, the chance of seeing a difference this large is about 1.2%".
Medical papers around the world report effects this way. Knowing what a p-value is lets you read health news one step deeper (real medical decisions are made by experts who weigh not only the p-value but also the size of the effect and the side effects).

A/B testing on websites (marketing)

"We changed the button color and the click-through rate went up. But was it just chance?" The test in an A/B test answers that. For example, a test statistic of \(Z = 2.17\) gives a two-tailed p-value of about 0.03, which is smaller than the 0.05 significance level, so you can conclude "an improvement that is hard to explain by chance".
Online companies use this p-value every day to decide whether to adopt changes in design and wording.

Quality control in a factory: has the process average drifted? (manufacturing)

Data from sample inspections is tested to see whether the average weight or size of products has drifted from the target. For example, a test statistic of \(Z = 2\) gives a two-tailed p-value of about 0.046, so at the 5% significance level you conclude "something has changed in the process" and look for the cause.
The strength of the p-value is that it separates "random variation" from "a real problem", so the decision to stop a machine can be made with numbers, not by feel.

Reading "p < 0.05" in research papers (psychology, economics and more)

Research papers are full of phrases such as "significant at p < 0.05" and "p = 0.003". In a two-tailed test, p < 0.05 matches "\(|Z|\) is greater than 1.96", and p < 0.01 matches "greater than about 2.58".
Knowing this link helps you report statistical results correctly in term papers and theses, and makes it easier to keep in mind a key point for reading papers: "significant" is not always the same as important (the size of the difference is a separate question).

Telling whether a change in a poll or survey is just noise

A hypothesis test can also check whether a change such as "presidential approval is up 2 points from last month" is a real change or just the variation (error) of the poll. For example, a test statistic of \(Z = 1\) gives a two-tailed p-value of about 0.32, "about 1 time in 3 by chance even with no real difference", so it is natural to call it within the margin of error.
It is a handy, everyday way of thinking with statistics: before getting excited or worried about numbers in the news, ask "is that difference significant?".

Formula and graph

Left-tailed p-value (the area used in a left-tailed test)
Graph
Standard notation (the usual math form)
\(P(x<Z)\) \(=\) \(\Phi(Z)\)
In words (symbols replaced with words)
② left-tailed p-value \(P(x<Z)\) \(=\) ① area to the left, \(\Phi(Z)\)
The formula in words
① Put the test statistic \(Z\) into the cumulative distribution function \(\Phi\) (phi) to get the value \(\Phi(Z)\) (\(\Phi(Z)\) is the area under the standard normal curve to the left of \(Z\))
② and that is the left-tailed p-value \(P(x<Z)\)
Quick example
When the test statistic is −1.5, the left-tailed p-value is
left-tailed p-value \(=\) area to the left, \(\Phi(-1.5)\)
\(\Phi(-1.5) \approx 0.066807\ \ (6.7\%)\)
Key idea
A left-tailed test is used when you want to check "is it too small compared with the standard?" (for example, is a bag of snacks filled with less than the label says?). The farther \(Z\) goes into the negative side, the smaller the left-tailed p-value. "It would be rare to get a value this small by chance if the null hypothesis were true", which is strong evidence against the null hypothesis.
Right-tailed p-value (the area used in a right-tailed test)
Graph
Standard notation (the usual math form)
\(P(x>Z)\) \(=\) \(1\) \(-\) \(\Phi(Z)\)
In words (symbols replaced with words)
③ right-tailed p-value \(P(x>Z)\) \(=\) ② total probability \(1\) \(-\) ① area to the left, \(\Phi(Z)\)
The formula in words
① Subtract the area to the left, \(\Phi(Z)\)
② from the total probability \(1\)
③ and you get the right-tailed p-value \(P(x>Z)\)
Quick example
When the test statistic is 2 (\(\Phi(2) \approx 0.97725\)), the right-tailed p-value is
right-tailed p-value \(=\) total probability \(1\) \(-\) area to the left (0.97725)
\(1 - 0.97725 = 0.02275\ \ (2.3\%)\)
Key idea
A right-tailed test is used when you want to check "is it too large compared with the standard?" or "did the improvement really increase it?". The total area under the standard normal curve is 1 (100%), so the area to the right of \(Z\) is "the whole 1 − the area to the left".
Two-tailed p-value (the area used in a two-tailed test)
Graph
Standard notation (the usual math form)
\(P\) \(=\) \(2\) \(\times\) \((\) \(1\) \(-\) \(\Phi(|Z|)\) \()\)
In words (symbols replaced with words)
④ two-tailed p-value \(P\) \(=\) ③ times 2 (both tails) \(\times\) \((\) ② total probability \(1\) \(-\) ① area to the left, \(\Phi(|Z|)\) \()\)
The formula in words
① Subtract the area to the left of the absolute value \(|Z|\), \(\Phi(|Z|)\)
② from the total probability \(1\) to get the area of the right tail
③ multiply it by 2 (the two tails, left and right)
④ and you get the two-tailed p-value \(P\)
Quick example
When the test statistic is 1.96 (\(\Phi(1.96) \approx 0.975\)), the two-tailed p-value is
two-tailed p-value \(=\) times 2 \(\times\) \((\) total probability \(1\) \(-\) area to the left (0.975) \()\)
\(2 \times (1 - 0.975) = 2 \times 0.025 = 0.05\ \ (5\%)\)
Key idea
A two-tailed test treats a gap in either direction, too large or too small, as a meaningful difference. It is the test used most often in real research and surveys. The absolute value \(|Z|\) is used so that a negative \(Z\) counts as "the same size of gap", treating both sides symmetrically. With \(Z = 1.96\) as in the example, the two-tailed p-value is almost exactly 0.05. That is where the most famous boundary (critical value) in statistics comes from: in a two-tailed test at the 5% significance level, "reject the null hypothesis if \(|Z|\) is greater than 1.96".
The p-value is "the probability of getting a result at least as extreme as the one observed, assuming the null hypothesis is true". Once Z is known, the p-value is an area in the tails of the standard normal distribution (left: \(\Phi(Z)\), right: \(1-\Phi(Z)\), two-tailed: \(2(1-\Phi(|Z|))\)). If the p-value is at or below the significance level (such as 0.05), reject the null hypothesis.

Symbols and terms

Symbols

\(P\) pee The p-value: the probability of getting, by chance, a result at least as extreme as the one observed, assuming the null hypothesis is true. The smaller it is, the harder it is to explain the result by chance.
\(Z\) zee The test statistic (the z value), calculated from the data and treated as following the standard normal distribution. This page finds p-values from Z. Calculating a z-score itself is covered in the related page, the z-score calculator.
\(\Phi(Z)\) phi of Z The cumulative distribution function of the standard normal distribution (mean 0, standard deviation 1). It returns the probability of a value below \(Z\), which is the area under the curve to the left of \(Z\).
\(\Phi^{-1}\) phi inverse (inverse of Φ) The function that works the other way from \(\Phi\). It takes a probability (area) and returns the Z that gives it. This calculator uses it to work back from a p-value to Z. (Example: \(\Phi^{-1}(0.975) \approx 1.96\))
\(|Z|\) absolute value of Z The size of \(Z\) without its sign. A two-tailed test counts a gap on the plus side and on the minus side as the same "extremeness", so it uses the absolute value. (Example: \(|-1.5| = 1.5\))
\(\alpha\) alpha The significance level: the cutoff probability you set in advance, as in "reject the null hypothesis if the p-value is at or below this". By convention, 0.05 (5%) and 0.01 (1%) are common.

Terms

p-value The probability of getting a result at least as extreme as the one observed, assuming the null hypothesis is true. The smaller the p-value, the harder it is to believe the result came about by chance, and the stronger the grounds for rejecting the null hypothesis.
hypothesis test A procedure that first assumes "there is no difference", measures with a p-value how unlikely the actual data would be under that assumption, and decides whether to throw the assumption out. It works much like proof by contradiction - if something very rare happened, doubt the starting assumption.
null hypothesis The default assumption you want to disprove, such as "there is no difference between the two groups" or "there is no effect". The p-value is calculated on the assumption that the null hypothesis is true.
alternative hypothesis The claim opposite to the null hypothesis ("there is a difference", "there is an effect"). It is the hypothesis accepted when the null hypothesis is rejected.
significance level The cutoff probability for rejecting the null hypothesis, written \(\alpha\) (alpha). The rule is to set it before running the test, and 0.05 is the most widely used. If the p-value is at or below the significance level, the result is called "statistically significant".
reject To throw out the null hypothesis as "hard to believe" based on the test. You reject it when the p-value is at or below the significance level. Note that failing to reject does not say "the null hypothesis is true"; it only says "there is not enough evidence to reject it".
two-tailed test A test that treats a gap in either direction, too large or too small, as a difference. The p-value is the sum of the areas in both tails of the distribution. It is the standard choice when you cannot decide the direction in advance.
one-tailed test A test that looks at gaps in only one direction, only larger (right-tailed) or only smaller (left-tailed). It is used when theory tells you the direction in advance, and the p-value is the area in that one tail only.
test statistic The value calculated from the data for a test. In a z-test, it is put in a form treated as following the standard normal distribution (the z value), which tells how many standard deviations the result is from the mean.
standard normal distribution The normal distribution with mean 0 and standard deviation 1 (a symmetric bell shape). The area under the curve is the probability, and the total area is exactly 1. The p-value of a z-test is calculated as the area in the tails of this distribution.
critical value The boundary value of the test statistic beyond which you reject the null hypothesis. For a two-tailed test at the 5% significance level it is \(|Z| \approx 1.96\), and at 1% it is \(|Z| \approx 2.576\). You can check these by working back from a p-value to Z with this calculator.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Basic probability (Grade 7)
  • Knowing that a probability is a number from 0 to 1, and that "the chance it happens" and "the chance it does not" add up to 1
  • Having a feel that "a 3% chance" is something rare that happens only about 3 times in 100
Data analysis and standard deviation (high school statistics)
  • Knowing that the mean and the standard deviation show the center and the spread of the data
  • Having a feel that a value "two standard deviations from the mean" is fairly rare
The normal distribution and reading areas (high school statistics / AP Statistics)
  • Being able to see the area between the curve and the horizontal axis as a share of the whole (a probability)
  • Knowing that the standard normal distribution (mean 0, standard deviation 1) is symmetric around 0 and has a total area of 1
The idea of hypothesis testing (AP Statistics)
  • Understanding the flow of a test - first assume "there is no difference" (the null hypothesis), then check how unlikely the data would be
  • Being comfortable with reasoning similar to proof by contradiction - "something very rare happened, so doubt the starting assumption"

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the left-tailed p-value
Z (test statistic) -1.5
Left-tailed P(x<Z) =NORM.S.DIST(B1,TRUE)
Table to find the right-tailed p-value
Z (test statistic) 2
Right-tailed P(x>Z) =1-NORM.S.DIST(B1,TRUE)
Table to find the two-tailed p-value
Z (test statistic) 1.96
Two-tailed p-value =2*(1-NORM.S.DIST(ABS(B1),TRUE))
After pasting, B1 is the input cell for Z and B2 shows the p-value, calculated automatically.
"NORM.S.DIST(value, TRUE)" is the function for the cumulative distribution function \(\Phi\) (the area to the left of Z), and TRUE tells it to "return the cumulative value (the area to the left)". "ABS" returns the absolute value (the size without the sign).
The first table shows about 0.0668 (about 6.7%) in B2, the second about 0.02275 (about 2.3%), and the third about 0.05 (5%). Just replace B1 with your own Z.
To go the other way, "from a p-value to Z", use "=NORM.S.INV(probability)" (example: the Z for a two-tailed p-value of 0.05 is `=NORM.S.INV(1-0.05/2)`, about 1.95996).

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the left-tailed p-value
Z (test statistic) -1.5
Left-tailed P(x<Z) =NORMSDIST(B1)
Table to find the right-tailed p-value
Z (test statistic) 2
Right-tailed P(x>Z) =1-NORMSDIST(B1)
Table to find the two-tailed p-value
Z (test statistic) 1.96
Two-tailed p-value =2*(1-NORMSDIST(ABS(B1)))
In Google Sheets, calculate the cumulative distribution function \(\Phi\) with "NORMSDIST(value)" (it works the same as "NORM.S.DIST(value, TRUE)" in Excel, but TRUE is not needed). Copy the whole table, paste it into cell A1, and change Z in B1.
The results are the same as in the Excel version: about 0.0668 in the first table, about 0.02275 in the second, and about 0.05 in the third.
To find Z from a p-value, use "=NORMSINV(probability)" (example: `=NORMSINV(1-0.05/2)` is about 1.95996).

How to calculate it in Python

import math

def phi(z):
    # Cumulative distribution function of the standard normal distribution, Φ(z) (calculated with the error function erf)
    return 0.5 * (1 + math.erf(z / math.sqrt(2)))

z = 1.96  # Z (test statistic)

p_left = phi(z)                       # left-tailed p-value P(x<Z)
p_right = 1 - phi(z)                  # right-tailed p-value P(x>Z)
p_two_sided = 2 * (1 - phi(abs(z)))   # two-tailed p-value

print(f"Left-tailed p-value: {p_left}")
print(f"Right-tailed p-value: {p_right}")
print(f"Two-tailed p-value: {p_two_sided}")
The standard library's math.erf (the error function) is all you need to calculate the cumulative distribution function \(\Phi\). Change the Z at the top and run it. If you need the other direction (p-value to Z), use NormalDist().inv_cdf() from the standard library's statistics module (example: the Z for a two-tailed p-value of 0.05 is `statistics.NormalDist().inv_cdf(1 - 0.05/2)`, about 1.95996).

How to write it in LaTeX and other math languages (copy and paste)

Left-tailed p-value (the area used in a left-tailed test)
P = Φ(Z)
P = \Phi(Z)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>P</mi>
    <mo>=</mo>
    <mi>&#x3A6;</mi><mo>(</mo><mi>Z</mi><mo>)</mo>
  </mrow>
</math>
P = Phi(Z)
CDF[NormalDistribution[0, 1], z]
with(Statistics): CDF(RandomVariable(Normal(0, 1)), z);
p = normcdf(z);
P = Φ(Z)
Right-tailed p-value (the area used in a right-tailed test)
P = 1 − Φ(Z)
P = 1 - \Phi(Z)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>P</mi>
    <mo>=</mo>
    <mn>1</mn>
    <mo>&#x2212;</mo>
    <mi>&#x3A6;</mi><mo>(</mo><mi>Z</mi><mo>)</mo>
  </mrow>
</math>
P = 1 - Phi(Z)
1 - CDF[NormalDistribution[0, 1], z]
with(Statistics): 1 - CDF(RandomVariable(Normal(0, 1)), z);
p = 1 - normcdf(z);
P = 1 - Φ(Z)
Two-tailed p-value (the area used in a two-tailed test)
P = 2(1 − Φ(|Z|))
P = 2\left(1 - \Phi(|Z|)\right)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>P</mi>
    <mo>=</mo>
    <mn>2</mn>
    <mo>(</mo>
    <mn>1</mn>
    <mo>&#x2212;</mo>
    <mi>&#x3A6;</mi><mo>(</mo><mo>|</mo><mi>Z</mi><mo>|</mo><mo>)</mo>
    <mo>)</mo>
  </mrow>
</math>
P = 2(1 - Phi(|Z|))
2 (1 - CDF[NormalDistribution[0, 1], Abs[z]])
with(Statistics): 2*(1 - CDF(RandomVariable(Normal(0, 1)), abs(z)));
p = 2*(1 - normcdf(abs(z)));
P = 2(1 - Φ(|Z|))

How to have ChatGPT  do the calculation

You are a statistics calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

A z-test gave a test statistic of Z = 2.5. Assume the test statistic follows the standard normal distribution (you may use Python's standard library, such as math.erf or statistics.NormalDist).
Find each of the following:
1. The left-tailed p-value P(x<Z)
2. The right-tailed p-value P(x>Z)
3. The two-tailed p-value P(x<−Z or x>Z)
4. Whether the null hypothesis can be rejected in a two-tailed test at the 0.05 significance level

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.