Forest plot generator

This forest plot generator draws a meta-analysis forest plot from a pasted table. Give each study’s event counts, or its estimate and 95% confidence interval, choose fixed or random effects, and download an editable SVG or a 300 dpi PNG. It works out the pooled estimate, I², τ², the Q test and a prediction interval, and writes the figure legend.
Forest plot generatorOr describe it in Studio →
Pasting from Excel works. A header row is fine.
ModelRisk ratio95% CIZp
Random effects0.4900.345 to 0.6954.00< 0.001

Heterogeneity: Q = 152.23, df = 12, p < 0.001; I² = 92.1%; τ² = 0.3088; 95% prediction interval 0.135 to 1.769.

Figure legend

To report

Forest plot of 13 studies. Squares show each study’s risk ratio, sized by its weight in the random-effects (DerSimonian–Laird) inverse-variance analysis; horizontal lines are 95% confidence intervals. The diamond is the pooled estimate and its width the 95% confidence interval. The dashed line is the 95% prediction interval. The x axis is logarithmic.

Check your result: find a study you know. Its square should sit at its reported estimate and its line should end at its reported 95% limits. On a ratio axis 0.5 and 2 sit the same distance from 1; if they do not, the axis is not logarithmic.
BCG trials in the worked example
13
BCG trials in the worked example
Q statistic, the same as R metafor
152.23
Q statistic, the same as R metafor
I², so random effects is the right model
92%
I², so random effects is the right model
data uploaded
0
data uploaded
  • Odds ratio, risk ratio, hazard ratio, mean difference
  • Fixed effect and random effects (DerSimonian–Laird)
  • I², τ², Q test and prediction interval
  • Editable SVG, 300 dpi PNG and results CSV
  • Checked against R metafor on the BCG trials

01

How to make a forest plot

  1. Choose what you have. Event counts per group (events and total for each arm) give an odds ratio, risk ratio or risk difference. If the papers report an estimate with a 95% confidence interval, such as a hazard ratio, choose “Estimates with 95% CI”.
  2. Paste one study per line, or open a CSV. Columns can be separated by commas, tabs or semicolons, so a block copied from Excel works, and a header row is skipped.
  3. Choose the pooled estimate: random effects, fixed effect, both, or none for a plot of subgroups or single results.
  4. Label each side of the line of no effect, for example “Favours treatment” and “Favours control”, and set the axis range if one wide interval squeezes the rest.
  5. Download the SVG to edit in Illustrator, Inkscape or PowerPoint, the PNG for a manuscript, or the CSV of weights and estimates for a supplementary table.

02

How to read a forest plot

Part of the plotWhat it means
Squareone study’s estimate; its area is the study’s weight in the meta-analysis
Horizontal linethat study’s 95% confidence interval
Vertical lineno effect: 1 for ratios, 0 for differences
Diamondthe pooled estimate; its width is the 95% confidence interval
Dashed line under the diamondthe 95% prediction interval: where the effect in a new, similar study would be expected to fall
I²the share of the variation between studies that is more than chance would produce

A study whose line crosses the vertical line did not show a significant effect on its own. If the diamond does not touch the line, the pooled effect is significant at the 5% level. Ratios are drawn on a logarithmic axis, so a risk ratio of 0.5 sits as far from 1 as a risk ratio of 2.

03

Fixed effect or random effects?

A fixed-effect analysis assumes every study estimates the same true effect, and weights each study by the inverse of its variance, so large trials dominate. A random-effects analysis assumes the true effect varies between studies; it adds the between-study variance τ² to every study’s variance, which spreads the weight more evenly and widens the pooled interval.

Fixed: wᵢ = 1 / SEᵢ² · Random: wᵢ = 1 / (SEᵢ² + τ²) · I² = (Q − df) / Q

τ² is estimated with the DerSimonian–Laird method. When the studies differ in population, dose or follow-up, random effects is the usual choice; choose “Both” to show the two diamonds together.

04

Worked example: the BCG vaccine trials

The example data are the 13 trials of the BCG vaccine against tuberculosis collected by Colditz et al. (JAMA, 1994), as published in the R metadat package (dataset dat.bcg). Risk ratios below 1 favour the vaccine.

ResultThis toolR metafor
Q (df = 12)152.23152.2330
Log risk ratio, Aronson 1948−0.8893−0.8893
Random-effects risk ratio0.490 (0.345 to 0.695), DerSimonian–Laird0.4894 (0.3441 to 0.6962), REML
Fixed-effect risk ratio0.650 (0.601 to 0.704)—
I²92.1%92.22% (REML)

The two random-effects results differ in the third decimal only because metafor estimates τ² by restricted maximum likelihood by default and this tool uses DerSimonian–Laird. An I² of 92% says the trials disagree far more than chance would explain, which is why the random-effects interval is much wider than the fixed-effect one.

05

Methods and file formats

  • From a 95% CI, the standard error is (ln upper − ln lower) ÷ (2 × 1.96) for ratios and (upper − lower) ÷ (2 × 1.96) for differences.
  • Odds and risk ratios from counts use the usual large-sample standard errors. A study with a zero cell gets 0.5 added to every cell; a study with no events in either group is left out, because it carries no information on a ratio.
  • Pooling is inverse-variance, the same method as RevMan’s generic inverse-variance analysis. Mantel–Haenszel pooling is not offered.
  • The prediction interval uses a t distribution with k − 2 degrees of freedom, so it needs at least three studies. R metafor uses the normal distribution by default, which gives a slightly narrower interval.
  • The SVG keeps every label as text and every square, line and diamond as a shape. The PNG is 2,760 pixels wide, 9.2 inches at 300 dpi.

06

Why many forest plots are drawn wrong

  • Ratios on a straight axis. Drawn linearly, a risk ratio of 0.5 sits half as far from 1 as a ratio of 2, so benefit looks smaller than harm. On a log axis they are the same distance: ln 0.5 = −0.693 and ln 2 = 0.693.
  • Standard errors taken from a ratio’s interval without logs. For Aronson 1948 (risk ratio 0.41, 95% CI 0.13 to 1.26), (1.26 − 0.13) ÷ 3.92 gives 0.288; the correct (ln 1.26 − ln 0.13) ÷ 3.92 gives 0.579, twice as large, and the study’s weight changes fourfold.
  • Fixed effect when the studies disagree. In the BCG trials (I² = 92%) the fixed-effect interval is 0.601 to 0.704; random effects gives 0.345 to 0.695, an honest picture of the uncertainty.
  • Squares all one size. A square’s area should show the study’s weight, or a 262-person trial (Aronson 1948) looks as convincing as the 176,782-person TPT Madras trial.
The 13 BCG trials drawn by this tool with both models. The black diamond (fixed effect, risk ratio 0.65) is far narrower than the orange one (random effects, 0.49): with I² = 92%, the fixed-effect interval overstates how sure the pooled result is.

Data: R metadat, dat.bcg (Colditz et al., JAMA 1994).

Trust

How this page is checked

  • The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
  • Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.

Cite this page

Sciloom. (2026). Forest plot generator. Zebra Nine Studio Inc. https://sciloom.si/forest-plot-generator

Read the full methodology · Who makes Sciloom

Frequently asked questions

What data do I need for a forest plot?

Either the number of events and participants in each group of every study, or each study’s effect estimate with its 95% confidence interval. Hazard ratios and adjusted odds ratios are usually only available in the second form.

Can I make a forest plot without pooling the studies?

Yes. Choose “No pooled estimate” to draw subgroup results or a set of single estimates, such as the odds ratios from one regression model.

Why is my odds ratio axis not evenly spaced?

Ratios are drawn on a log scale, which is the convention for forest plots: it makes 0.5 and 2 the same distance from 1, so harm and benefit look the same size.

Can I edit the forest plot afterwards?

Yes. Download the SVG and open it in Illustrator, Inkscape, Affinity Designer or PowerPoint. Study names, numbers and axis labels are real text.

Is my data uploaded?

No. The plot and the meta-analysis are calculated in your browser. A CSV you open is read on your computer and not sent to a server.

Making the PRISMA flow diagram for the same review? The PRISMA generator fills in the counts.
Free to start, no sign-up.
Back to the tool ↑

More research tools