Box plot and violin plot maker with statistics
Paste your groups (one column each, straight from Excel) and the tool draws a box plot (median, quartiles, 1.5 × IQR whiskers and outliers) or a violin plot (Gaussian kernel density) with every data point shown. It tests the groups: Welch’s t-test or the Mann–Whitney U test for two groups, one-way ANOVA with Tukey–Kramer or Kruskal–Wallis with Dunn’s test for three or more, and adds significance brackets with stars or p-values. A summary table gives n, mean, SD, SEM, median and IQR, and the plot downloads as SVG or 300 dpi PNG.
- What it does
- Draws a box plot or violin plot of pasted groups with every point jittered, tests the groups (Welch t / Mann–Whitney, ANOVA / Kruskal–Wallis) and adds significance brackets.
- Formula
- Example
- Tumour volumes of 8 vehicle mice (mean 983 mm³, SD 183.6) vs 8 Drug A mice (mean 667.5, SD 84.0): Welch t(9.80) = 4.42, p = 0.0014; Mann–Whitney U = 63, exact p = 0.00031.
Last updated
Loading Box plot and violin plot maker…
At a glance
| Input | One column per group (names in the first row), or group name and value in two columns |
|---|---|
| Box plot | Median, Q1–Q3 (linear interpolation), whiskers to |
| Violin | Gaussian KDE, Silverman bandwidth |
| Tests | Welch t, Mann–Whitney U (exact without ties), one-way ANOVA + Tukey–Kramer, Kruskal–Wallis + Dunn (Holm) |
| Accuracy | Statistics and p-values match SciPy |
| Export | SVG and 300 dpi PNG plot; CSV summary and tests |
| Runs in | Your web browser; nothing is uploaded |
| Price | Free, no account needed |
What it does
How to use the box plot and violin plot maker
- Paste the groupsCopy your columns from Excel or Prism with the group names in the first row. A two-column list of group name and value also works.
- Pick the plot and the testChoose box, violin or both, and Welch t / ANOVA for roughly normal data or Mann–Whitney / Kruskal–Wallis for skewed data, scores or outliers.
- Read and exportRead the p-value, the pairwise comparisons and the summary table, then download the plot as SVG or PNG and the statistics as CSV.
How it works
Box plot. The box runs from the first quartile (
Violin plot. A violin is a box plot with the density of the data drawn on both sides (Hintze and Nelson 1998). The density is a Gaussian kernel estimate density() and ggplot2’s geom_violin). Each violin is scaled to the same maximum width and cut at the smallest and largest value.
Two groups. Welch’s t-test compares means without assuming equal variances, with Welch–Satterthwaite degrees of freedom (Welch 1947):
It is the better default than Student’s t-test, losing little power when variances are equal (Delacre et al. 2017). The Mann–Whitney U test ranks all values together:
Three or more groups. One-way ANOVA:
with
with
divided by the tie correction
Accuracy. The t, F,
Sources: Welch BL. The generalization of ‘Student’s’ problem when several different population variances are involved. Biometrika 1947;34:28–35, doi:10.1093/biomet/34.1-2.28. Mann HB, Whitney DR. On a test of whether one of two random variables is stochastically larger than the other. Ann Math Stat 1947;18:50–60, doi:10.1214/aoms/1177730491. Kruskal WH, Wallis WA. Use of ranks in one-criterion variance analysis. J Am Stat Assoc 1952;47:583–621, doi:10.1080/01621459.1952.10483441. McGill R, Tukey JW, Larsen WA. Variations of box plots. Am Stat 1978;32:12–16, doi:10.1080/00031305.1978.10479236. Hintze JL, Nelson RD. Violin plots: a box plot-density trace synergism. Am Stat 1998;52:181–184, doi:10.1080/00031305.1998.10480559. Delacre M, Lakens D, Leys C. Why psychologists should by default use Welch’s t-test instead of Student’s t-test. Int Rev Soc Psychol 2017;30:92–101, doi:10.5334/irsp.82. Silverman BW. Density Estimation for Statistics and Data Analysis. London: Chapman & Hall; 1986.
Worked example: tumour volume in three groups of mice
The built-in data are tumour volumes (mm³) of three groups of 8 mice: vehicle, Drug A and Drug B.
| Group | n | Mean | SD | Median | Q1–Q3 (IQR) | Outliers |
|---|---|---|---|---|---|---|
| Vehicle | 8 | 983 | 183.6 | 960.5 | 870.5–1040.75 (170.25) | 1350 |
| Drug A | 8 | 667.5 | 84.0 | 671.5 | 612.5–718.75 (106.25) | none |
| Drug B | 8 | 529.4 | 208.2 | 455 | 406.25–542.5 (136.25) | 1010 |
Box plot by hand (vehicle). Sorted: 768, 812, 890, 945, 976, 1020, 1103, 1350.
Three groups, parametric. One-way ANOVA gives
Three groups, non-parametric. Kruskal–Wallis
Two groups. Delete the Drug B column to compare vehicle and Drug A only. Welch’s t-test: the standard error is
| Roughly normal data | Skewed data, scores, outliers | |
|---|---|---|
| 2 groups | Welch’s t-test | Mann–Whitney U test |
| 3 or more groups | One-way ANOVA + Tukey–Kramer | Kruskal–Wallis + Dunn (Holm) |
Not sure which test fits your design (paired data, counts, correlations)? Use the statistical test chooser.
Frequently asked questions
How do I make a box plot with p-values?
Paste one column per group with names in the first row, pick Welch t / ANOVA (normal data) or Mann–Whitney / Kruskal–Wallis (skewed data), and the plot shows brackets with stars or p-values between the groups that differ. Download it as SVG or a 300 dpi PNG.
What do the whiskers of a box plot show?
Here, and in most software (R, ggplot2, Prism’s “Tukey” option), the whiskers reach the most extreme data points within
Box plot or violin plot: which should I use?
A box plot summarises five numbers and works for any sample size. A violin also shows the shape of the distribution, such as two peaks, but needs more data (about 20 or more values per group) to be meaningful. With small n, show every point on top of either one.
Should I use a t-test or Mann–Whitney?
Use Welch’s t-test when each group is roughly normal or the groups are large (about 30 or more). Use Mann–Whitney for scores, strongly skewed data or outliers with small groups. Decide before looking at the p-values; the test chooser helps.
Why Welch’s t-test instead of Student’s t-test?
Welch’s test does not assume the two groups have equal variances. When they are equal it gives almost the same result as Student’s test, and when they differ it keeps the false-positive rate correct, so it is the safer default.
Why not run t-tests between every pair of 3 groups?
Each extra test adds a chance of a false positive. ANOVA or Kruskal–Wallis tests all groups at once, and Tukey–Kramer or Dunn’s test with Holm adjustment compares the pairs while keeping the overall error at 5%.
How is an outlier defined in a box plot?
A point below
What do the stars mean?
*
Link to this tool
Using it in a protocol, lab wiki or course page? Copy a link or citation.
<a href="https://www.labcanvas.com/tools/box-plot-maker">Box plot and violin plot maker</a> (LabCanvas)LabCanvas. Box plot and violin plot maker [online tool]. https://www.labcanvas.com/tools/box-plot-makerMake the full figure
The LabCanvas Graphs app draws box, violin and dot plots with the same tests plus paired and repeated-measures designs, two-way ANOVA and more, styled for journals.
Open the Graphs app