March 24th, 2026
One-Sample T-Test: What It Is + Step-By-Step Guide
By Tyler Shibata · 16 min read
What is a one-sample t-test?
A one-sample t-test is a statistical test that checks whether the average of your data matches a specific target number. You supply one dataset and one target value, and the test tells you whether the difference between them is real or just random noise.
For example, a marketing team can use it to check whether average email open rates actually hit a 25% quarterly target, or whether the difference is small enough to overlook.
When should you use a one-sample t-test?
You should use a one-sample t-test when you have a set of numbers and a specific target you want to measure them against.
Here are some common use cases of one-sample t-tests:
Checking performance against a goal: Your team has weekly sales figures, and you want to know whether the average actually hits a specific target, like $10,000 per week.
Quality control: A manufacturer needs to verify whether the average weight of a product batch matches the required specification, rather than just eyeballing whether it looks close.
Business benchmarking: A company wants to find out whether average customer satisfaction scores this quarter line up with a company-wide standard, or whether the gap is large enough to flag.
Marketing analysis: Your team needs to know whether average click-through rates (CTRs) from a campaign genuinely reached the benchmark set at the start, not just whether they looked good at a glance.
One-sample t-test assumptions and data requirements
Before you run a one-sample t-test, your data needs to meet a few conditions. If any of these don't hold, the results may not be reliable.
Check these before you run the test:
Numerical data: Your data needs to be measurable in numbers, like revenue figures, response times, or satisfaction scores. The test isn't designed for categorical responses like yes or no answers.
Random sampling: Your data should come from a random sample of the larger group you're drawing conclusions about. If your sample was collected in a biased way, the results may not reflect the broader population you're trying to understand.
Independent observations: Each data point needs to be separate from the others. One person's response or one transaction shouldn't influence another.
Roughly normal distribution: With smaller samples, your data works best when it follows a roughly bell-shaped curve. With 30 or more data points, the test becomes more forgiving and this condition matters less.
A known target value: You need a specific number to test against before you run the test. The test compares your sample average to that fixed value, so it needs to exist before you start.
The good news is that most business datasets, like sales figures, response times, and survey scores, naturally meet most of these conditions. The one worth double-checking is whether your sample was collected randomly, since that's the condition many are likely to overlook. I'd recommend going through this list before you start, especially if your data came from a single source or time period.
One-sample t-test formula
The one-sample t-test formula takes four pieces of information from your data and combines them into a single number called a t-value. That number measures the gap between your sample average and your target. The bigger the t-value, the more meaningful that gap is likely to be.
Here's what each piece means before you see the formula:
x̄ (your sample mean): The average of your actual data, calculated from the numbers you collected.
μ (your target value): The fixed number you're comparing your data against, like a sales goal or a quality standard.
s (standard deviation): A measure of how spread out your data points are from the average. Most spreadsheet tools and analysis platforms calculate this for you once you've entered your data. For example, in Excel or Google Sheets, you can get this number using the STDEV function on your dataset.
n (sample size): The number of data points in your dataset.
Put together, the formula looks like this:
t = (x̄ - μ) / (s / √n)
One-sample t-test example
Your team's average weekly sales are $11,200, your target is $10,000, your standard deviation is $3,000, and you have 30 data points.
Here’s what each variable represents:
x̄ (sample mean): $11,200 (your team's average weekly sales)
μ (target value): $10,000 (your weekly sales goal)
s (standard deviation): $3,000 (how much your weekly figures vary)
n (sample size): 30 data points
Plugging those in gives you:
t = (11,200 - 10,000) / (3,000 / √30) = 1,200 / 547.7 ≈ 2.19
Here's what each step is doing:
11,200 - 10,000 = 1,200: The gap between your sample average and your target.
3,000 / √30 = 547.7: Your standard error, which adjusts for how consistent your data is and how many data points you have.
1,200 / 547.7 ≈ 2.19: Your t-value, the final result that tells you how meaningful the gap is.
A t-value of 2.19 suggests the gap between your sample average and your target is likely meaningful. In practice, that means your team's sales performance may be above the $10,000 target rather than the difference appearing by chance.
How to perform a one-sample t-test using a tool like Julius
Many analysis tools can run a one-sample t-test for you once you've set up your data correctly. For this walkthrough, we'll use Julius, which lets you run the test by typing your question in plain English.
Here's how:
Step 1: Upload your data
Start by uploading your dataset to Julius. You can drag and drop a CSV or Excel file directly into the chat, or connect a data source like Google Sheets, Postgres, or Snowflake if your data lives there.
Step 2: Set your target value
Decide on the fixed number you want to test your data against. This could be a sales goal, a quality standard, or any benchmark that's relevant to your analysis.
Step 3: Ask Julius to run the test
Type your question in plain English. Something like "run a one-sample t-test on my weekly sales data against a target of $10,000" is enough to get started. Julius will write and execute the code for you.
Step 4: Review your results
Julius will return your t-value, your p-value, and a plain-English interpretation of what the results mean. A p-value below 0.05 generally means the gap between your sample average and your target is statistically meaningful.
Step 5: Export or share your results
Once you have your results, you can download them as a CSV or PDF, or share them directly from Julius via a link.
One-sample t-test vs. z-test
A z-test serves a similar purpose as a t-test, but is designed for larger datasets where you already have a complete picture of how much variability exists across all your data.
Here’s how they compare:
| One-sample t-test | Z-test |
|---|---|---|
Sample size | Works well with smaller samples (under 30 data points) | Better suited to larger samples (30 or more data points) |
Standard deviation | Use when you don't know it (most business situations) | Use when you already know it |
When to use | Most real-world business analysis | Large datasets where the full data spread is known |
In practice, many business analyses rely on the t-test. You often don't have access to standard deviation data for your entire customer base, market, or organization ahead of time, and most business datasets don't have thousands of data points. If you're not sure which one applies to your situation, I’d say the t-test is the safer default in most cases.
Tools you can use for one-sample t-tests
Several tools can run a one-sample t-test, ranging from spreadsheet software to dedicated analysis platforms. Here's a quick rundown:
Julius: An AI-powered data analysis tool that lets you run a one-sample t-test by typing your question in everyday language. You upload your dataset, ask Julius to run the test, and it handles the calculation and interpretation for you.
Excel: A widely used spreadsheet tool where you can calculate a one-sample t-test manually using formulas. Some analysts simulate the test using the T.TEST function by comparing their sample to a column containing the target value.
Google Sheets: A cloud-based spreadsheet tool where you can calculate a one-sample t-test manually or approximate it using the T.TEST function with a reference column.
SPSS: A dedicated statistical software tool used widely in research and academia. It offers more advanced options than spreadsheet tools, but it comes with a steeper learning curve and a higher price tag.
R: A free, open-source programming language built for statistical analysis. It's highly capable but requires coding knowledge, so it's better suited to technical users than business teams.
Common mistakes to avoid
A one-sample t-test is straightforward, but a few missteps can lead you to the wrong conclusion. Here are the most common mistakes to watch out for:
Using the wrong test: A one-sample t-test is designed for situations where you're comparing one group of data against a fixed target. If you're comparing two separate groups against each other, you need a two-sample t-test instead. I've seen this mix-up happen most often when people are new to hypothesis testing.
Confusing your sample mean with your full dataset average: Your sample mean is the average of the data points you collected, not the average of your entire dataset. If your sample wasn't representative, your results likely won't be either.
Running multiple t-tests on the same dataset: Each additional t-test you run on the same data increases the chance of getting a significant result by chance. I'd recommend looking into methods like ANOVA, which is built to handle multiple comparisons on the same dataset without inflating your results.
Drawing conclusions from a single test without context: A significant result doesn't tell the whole story on its own. I'd always look at the size of the difference alongside the p-value before making any decisions.
Want to run a one-sample t-test without the math? Try Julius
A one-sample t-test shows you whether your data actually hits a target, but running one manually takes time and leaves room for error. With Julius, you can upload your dataset, type your question in plain English, and get your t-value, p-value, and a clear interpretation of the results without writing a single line of code.
Here’s how Julius helps:
Direct connections: Link databases like PostgreSQL, Snowflake, and BigQuery, or integrate with Google Ads and other business tools. You can also upload CSV or Excel files. Your analysis can reflect live data, so you’re less likely to rely on outdated spreadsheets.
Hypothesis testing without coding: Ask whether your sample average differs from a target value and review the resulting t-value and p-value without writing statistical formulas.
Follow-up analysis in the same workspace: After running a t-test, you can continue asking questions about the same dataset to explore trends, segments, or outliers.
Repeatable Notebooks: Save an analysis as a notebook and run it again with fresh data whenever you need. You can also schedule notebooks to send updated results to email or Slack.
Smarter over time: Julius includes a Learning Sub Agent, an AI that adapts to your database structure over time. It learns table relationships and column meanings as you work with your data, which can help improve result accuracy.
Built-in visualization: Get histograms, box plots, and bar charts on the spot instead of jumping into another tool to build them.
One-click sharing: Turn an analysis into a PDF report you can share without extra formatting.
Ready to run your first one-sample t-test on your own data? Try Julius for free today.
Frequently asked questions
What does a p-value mean in a one-sample t-test?
A p-value measures the probability that your results occurred by chance rather than reflecting a real difference. A p-value below 0.05 is the most commonly used threshold, meaning there's less than a 5% chance the gap between your sample average and your target is random. The lower the p-value, the more confident you can be that your result is meaningful.
What sample size do I need for a one-sample t-test?
Most statisticians recommend at least 30 data points for a one-sample t-test to produce reliable results. With smaller samples, your results are more sensitive to outliers and variability in your data. If you're working with fewer than 30 data points, treat your results with caution and consider collecting more data before drawing conclusions.
Can I run a one-sample t-test in Excel?
Yes, you can run a one-sample t-test in Excel, but you usually calculate it manually using formulas rather than a built-in test. You first calculate the sample mean, standard deviation, and sample size, then compute the t-value and compare it to a critical value or calculate the p-value.