Violin Plot vs Box Plot: Differences and When to Use Each

A practical comparison of violin plots and box plots, with a table and a simple way to choose between them.

A box plot summarizes a distribution with five numbers: the median, the two quartiles and the whisker ends, plus any outliers. A violin plot shows the full shape of the distribution as a smoothed density curve, usually with a small box plot drawn inside. Use a box plot when you need a clean summary for a general audience; use a violin plot when the shape of the data matters, especially if it might have more than one peak.

Below we compare what each chart shows, where each one wins, and the cases where picking the wrong one can hide something important.

What a box plot shows

A box plot (also called a box-and-whisker plot) draws:

  • A box from the first quartile (Q1, 25th percentile) to the third quartile (Q3, 75th percentile). This range is the interquartile range, or IQR.
  • A line inside the box at the median.
  • Whiskers that extend from the box. The most common rule, from John Tukey, extends each whisker to the farthest data point within 1.5 times the IQR from the box edge. Some tools use other rules, such as the minimum and maximum, so check the caption.
  • Individual points beyond the whiskers, flagged as potential outliers.

That is a compact, well-understood summary. Most readers with any statistics background know how to read it.

What a violin plot shows

A violin plot replaces the box with a mirrored density curve built from a kernel density estimate. The width of the shape at each value shows how many observations fall near that value. Most tools also draw a miniature box plot or quartile lines inside the violin, so you still get the median and IQR.

If you are new to the chart, our guide on how to read a violin plot walks through every part of it. For the bigger picture, including history and terminology, see the violin plot guide.

Side-by-side comparison

FeatureBox plotViolin plot
Median and quartilesYesYes, if an inner box or quartile lines are drawn
Full distribution shapeNoYes
Shows multiple peaksNoYes
Shows outliers as pointsYes, by defaultNot by default; tails are smoothed
Depends on a smoothing settingNoYes (bandwidth)
Reliable with small samplesFairly, but still only five numbersLess so; the curve can mislead
Easy for general audiencesYesTakes a short explanation
Space needed per groupNarrowWider
Can suggest values outside the dataNoYes, if the curve is not trimmed

Where box plots hide information

The classic weakness of a box plot is that very different distributions can produce the same box.

Picture two groups of test scores. Group A is a single bell-shaped cluster centered on 70. Group B is two clusters, one around 55 and one around 85, with almost nobody in between. Both groups can have a median near 70 and similar quartiles. Their box plots look nearly identical.

A violin plot shows the difference at once. Group A is a single bulge. Group B has two bulges with a narrow waist where the median sits. That waist tells you the “typical” score of 70 almost never occurs in group B. Any conclusion based on the median alone would be wrong.

This matters in practice whenever your data might mix subgroups: two types of customers, two cell populations, responders and non-responders to a treatment, weekday and weekend traffic. Bimodal and multimodal data are the strongest reason to choose a violin plot.

Box plots also hide skew detail. You can see that one whisker is longer than the other, but you cannot see whether the long tail is a smooth slope or a separate cluster of high values.

Where box plots win

Small samples

A box plot computes five numbers directly from the data. A violin plot estimates a smooth curve, and with few points that curve is mostly guesswork. With, say, eight observations, a violin can show bumps and tails that come from the smoothing rather than the data. For small groups, a box plot with the raw points overlaid is usually more honest. Or skip both summaries and show the points themselves; see violin plots with data points for ways to combine them.

Outliers

Box plots flag individual outliers as dots. A violin plot turns a lone extreme value into a faint, thin tail that is easy to miss. If spotting specific outliers is the point of the chart, a box plot does that job better.

Many groups

When you compare 20 or 30 groups, box plots stay readable because they are narrow. Violins need room to show their shape, and a crowded row of them becomes hard to scan.

Unfamiliar audiences

Box plots are taught in introductory statistics and appear in many textbooks. Violin plots usually need a sentence of explanation for readers outside science and data work. If your readers will not stop to learn a new chart, the box plot is safer.

Where violin plots win

  • Multimodal data. Two or more peaks are the main case, as described above.
  • Larger samples. With hundreds or thousands of points per group, the density curve is stable and the extra detail is real.
  • Shape comparisons. When the question is “do these groups differ in shape, not only in center?”, a violin plot answers it directly.
  • Two-level comparisons. A split violin plot puts two sub-groups on each side of one violin, which makes paired comparisons compact.
  • Scientific figures. Fields like genomics often use violins to show gene expression levels across cell types, where distributions are frequently skewed or have many zeros.

The common compromise: both at once

You rarely have to choose only one. The default violin in seaborn draws a mini box plot inside the shape, so readers who know box plots can still find the median and IQR. Another common pattern is a narrow box plot inside a translucent violin, with or without points.

If you are working in Python, a side-by-side comparison takes a few lines with seaborn 0.13:

import seaborn as sns
import matplotlib.pyplot as plt

# df has a "group" column and a numeric "value" column
fig, (left, right) = plt.subplots(1, 2, figsize=(10, 4), sharey=True)
sns.boxplot(data=df, x="group", y="value", ax=left)
sns.violinplot(data=df, x="group", y="value", inner="box", ax=right)
plt.savefig("box_vs_violin.png", dpi=150)

If you would rather not write code, paste your numbers into our free online violin plot maker, pick a style and download the chart.

How to decide

Ask these questions in order:

  1. Could the data have more than one peak? If yes, or if you do not know, start with a violin plot so you can see.
  2. How many points per group? Under about 20 to 30, prefer a box plot or the raw points. Above that, a violin works well.
  3. Do individual outliers matter? If yes, use a box plot, or add the points to the violin.
  4. Who is reading? For a general audience, a box plot or a clearly labeled violin with a short caption.
  5. How many groups? For many groups, box plots stay cleaner.

A practical habit: draw the violin first when exploring your own data, because it shows shape problems early. Then decide which chart to publish based on your audience and sample size.

FAQ

Is a violin plot better than a box plot?

Neither is better in every case. A violin plot shows more about shape and reveals multiple peaks. A box plot is simpler, handles small samples and outliers better, and is more widely understood.

Can a box plot show bimodal data?

No. A box plot only shows the median, quartiles and whiskers, so two clusters and one wide cluster can produce the same box. Use a violin plot, a histogram or the raw points to see bimodality.

Why do violin plots have a box plot inside?

The inner box keeps the familiar summary (median and interquartile range) while the outer shape adds the density. It lets readers who know box plots get their bearings quickly.

When should I not use a violin plot?

Avoid it for very small samples, when individual outliers are the focus, or when your audience is unfamiliar with it and you cannot add an explanation.

Can I make a violin plot without coding?

Yes. You can create a violin plot in your browser by pasting numbers, choosing a style and downloading the image. No signup needed.

Adrian Lee
Adrian Lee

Adrian Lee is the Data Visualization Specialist and Statistical Analyst at ViolinPlot. Based in Boston, Massachusetts, Adrian utilizes a robust background in statistics and data science to create compelling and insightful visualizations that help interpret complex data.

With extensive experience in data analysis and visualization techniques, Adrian specializes in developing violin plots and other advanced graphical representations to convey statistical information effectively. Adrian’s expertise includes statistical modeling, data interpretation, and the creation of interactive visualizations.

At ViolinPlot, Adrian is responsible for transforming raw data into visual narratives that are both informative and engaging.

By employing state-of-the-art visualization tools and statistical methods, Adrian ensures that the visual representations are accurate, clear, and valuable for decision-making processes.

Adrian’s dedication to enhancing data comprehension through visual tools has established ViolinPlot. As a leading resource for data visualization and statistical analysis.

Articles: 89

Ready to Unlock Deeper Data Insights?

Transform complex datasets into clear, interactive visualizations with Violin Plot. Start exploring data distributions in a way that empowers insight and drives smarter decisions.

LEARN MOre
100% satisfaction guaranteed
McAfee SECURE
ssl-secured
verisign-secured
BEST-PRICE-GUARANTEED-free-trust-badge
guaranteed-safe-checkout-1