Forest Plot Maker for Meta-Analysis

Make a publication-ready forest plot online, free and without software. Enter each study’s events and totals, means and SDs, or effect estimate with its 95% confidence interval. The generator pools them with a fixed-effect or random-effects model, reports I², τ² and a prediction interval, and exports the figure as PNG or SVG. Calculations run in your browser; nothing you enter is sent or stored.

Data and model

Your data

Events and totals in each group, for odds ratios, risk ratios and risk differences.

Pooled on the log scale; plotted on a log axis with the line of no effect at 1.

Pooling

Inverse-variance random-effects model.

Labels and axis

Intervals beyond a fixed axis end in an arrow.

Load an example

Studies

Blank rows are ignored. Nothing you enter leaves your browser.

Study data for the forest plot
StudyVaccinated eventsVaccinated totalControl eventsControl totalRemove
Paste from Excel, Google Sheets or CSV

One study per line: study name, then vaccinated events, vaccinated total, control events, control total. Tabs or commas both work, and a header line is skipped.

Pooled RR 0.49 (95% CI 0.34 to 0.70) · I² = 92% · p < 0.001 · 13 studies

Scroll sideways to see the whole plot. Downloads are full width.

Forest plot of risk ratio (relative risk)Random-effects model (REML): pooled RR 0.49 (95% CI 0.34 to 0.70) from 13 studies, I² 92%.StudyVaccinatedEvents/TotalControlEvents/TotalRR (95% CI)WeightAronson 19484/12311/1390.41 [0.13, 1.26]5.1%Ferguson & Simes 19496/30629/3030.20 [0.09, 0.49]6.4%Rosenthal 19603/23111/2200.26 [0.07, 0.92]4.4%Hart & Sutherland 197762/13598248/128670.24 [0.18, 0.31]9.7%Frimodt-Møller 197333/506947/58080.80 [0.52, 1.25]8.9%Stein & Aronson 1953180/1541372/14510.46 [0.39, 0.54]10.1%Vandiviere 19738/254510/6290.20 [0.08, 0.50]6.0%TPT Madras 1980505/88391499/883911.01 [0.89, 1.14]10.2%Coetzee & Berjak 196829/749945/72770.63 [0.39, 1.00]8.7%Rosenthal 196117/171665/16650.25 [0.15, 0.43]8.4%Comstock 1974186/50634141/273380.71 [0.57, 0.89]9.9%Comstock & Webster 19695/24983/23411.56 [0.37, 6.53]3.8%Comstock 197627/1691329/178540.98 [0.58, 1.66]8.4%Random-effects model (REML)0.49 [0.34, 0.70]100%Prediction interval[0.13, 1.78]0.050.10.20.512510← Favours vaccineFavours control →Heterogeneity: I² = 92%, τ² = 0.313, Q = 152.23 (df = 12), p < 0.001Test for overall effect: z = −3.97, p < 0.001

Methods and results text

Studies were pooled with a random-effects inverse-variance model on the log risk ratio scale, with τ² estimated by restricted maximum likelihood (REML). Heterogeneity was assessed with Cochran's Q and I², and between-study variance with τ². A 95% prediction interval was calculated with a t distribution on k − 2 degrees of freedom. Across 13 studies, the pooled risk ratio was 0.49 (95% CI 0.34 to 0.70; p < 0.001), with I² = 92% (Q = 152.23, df = 12, p < 0.001) and τ² = 0.313; the 95% prediction interval was 0.13 to 1.78.

Heterogeneity

I²
92.1%
Cochran's Q
152.23 (df 12)
Q test
p < 0.001
τ²
0.3132
τ
0.5597
Prediction interval
0.13 to 1.78
R code to reproduce this plot (metafor)
# install.packages("metafor")
library(metafor)

dat <- data.frame(study = c("Aronson 1948", "Ferguson & Simes 1949", "Rosenthal 1960", "Hart & Sutherland 1977", "Frimodt-Møller 1973", "Stein & Aronson 1953", "Vandiviere 1973", "TPT Madras 1980", "Coetzee & Berjak 1968", "Rosenthal 1961", "Comstock 1974", "Comstock & Webster 1969", "Comstock 1976"),
  ai = c(4, 6, 3, 62, 33, 180, 8, 505, 29, 17, 186, 5, 27), n1i = c(123, 306, 231, 13598, 5069, 1541, 2545, 88391, 7499, 1716, 50634, 2498, 16913),
  ci = c(11, 29, 11, 248, 47, 372, 10, 499, 45, 65, 141, 3, 29), n2i = c(139, 303, 220, 12867, 5808, 1451, 629, 88391, 7277, 1665, 27338, 2341, 17854))
dat <- escalc(measure = "RR", ai = ai, n1i = n1i, ci = ci, n2i = n2i, data = dat, drop00 = TRUE)

res <- rma(yi, vi, data = dat, slab = study, method = "REML")
res
forest(res, atransf = exp, showweights = TRUE, header = TRUE, addpred = TRUE)
# metafor's prediction interval method can differ from the t(k - 2) interval on journalmetrics.org.

How to make a forest plot

  1. Choose how your data are reported. Use 2×2 counts when you have events and totals for each group, means and SDs for continuous outcomes, or an estimate with its 95% confidence interval when the studies report hazard ratios, adjusted odds ratios or other ready-made effects.
  2. Pick the effect measure. Odds ratio, risk ratio, risk difference, hazard ratio, mean difference or standardized mean difference. Ratios are pooled on the log scale and drawn on a log axis.
  3. Enter or paste one row per study. Type into the table, or copy the columns from Excel or Google Sheets and paste them in. Invalid cells are highlighted and the plot updates as soon as they are fixed.
  4. Choose the model and labels, then download. Random effects (REML) is the default. Set what each side of the line of no effect favours, add a title if your journal wants one, and download the forest plot as PNG or SVG. Copy the methods text and results table for your manuscript.

Studies are drawn in the order entered unless you sort them by effect size or weight. Group names, axis limits and decimal places are under “Labels and axis”.

What data you need for each effect measure

Effect measures supported by the forest plot maker
Effect measureWhat to enterAxisTypical use
Odds ratio (OR)2×2 counts, or OR with 95% CILog scale, null at 1Binary outcomes; case–control studies; logistic regression
Risk ratio (RR)2×2 counts, or RR with 95% CILog scale, null at 1Binary outcomes in trials and cohorts
Hazard ratio (HR)HR with 95% CILog scale, null at 1Time-to-event outcomes such as survival
Risk difference (RD)2×2 counts, or RD with 95% CILinear, null at 0Absolute effects of binary outcomes
Mean difference (MD)Mean, SD and n per group, or MD with 95% CILinear, null at 0Continuous outcomes on the same scale
Standardized mean difference (Hedges' g)Mean, SD and n per group, or SMD with 95% CILinear, null at 0Continuous outcomes measured on different scales

Use one effect measure per plot. Do not mix odds ratios and risk ratios in the same analysis; if some studies report only one of them, convert or analyse them separately and explain the choice.

How to read a forest plot

Each row is one study. The square marks the study’s effect estimate and its area reflects the study’s weight, so larger, more precise studies have bigger squares. The horizontal line is the 95% confidence interval. The vertical line of no effect sits at 1 for ratios and 0 for differences: a study whose interval crosses it is compatible with no difference at the 5% level.

The diamond at the bottom is the pooled estimate, with its width showing the 95% confidence interval. Under a random-effects model, the open bar below it is the 95% prediction interval: the range in which the effect of a new study in a similar setting would be expected to fall. When the diamond is clear of the null line but the prediction interval crosses it, the average effect is beneficial but some settings may see no benefit.

Which side of the line favours treatment depends on the outcome. For a harmful outcome such as death, a ratio below 1 favours the intervention; for a good outcome such as recovery, it favours the control. Always label both sides. Our guide on how to read and report a forest plot in a meta-analysis covers interpretation and common reviewer comments in more depth.

How the pooled estimate is calculated

Each study contributes an effect yi (the log ratio for ratio measures) with sampling variance vi. For 2×2 counts the log odds ratio has variance 1/a + 1/b + 1/c + 1/d; the log risk ratio has 1/a − 1/n₁ + 1/c − 1/n₂. For a ratio entered with a 95% CI, the standard error is recovered from the interval:

SE = (ln U − ln L) / (2 × 1.959964)

Studies are combined with inverse-variance weights, where τ² is 0 in the fixed-effect model:

wi = 1 / (vi + τ²),   μ̂ = Σwiyi / Σwi,   SE(μ̂) = 1 / √Σwi

Heterogeneity is measured with Cochran’s Q, computed with fixed-effect weights, and I² (Higgins and Thompson, 2002):

Q = Σwi(yi − μ̂)²,   I² = max(0, (Q − df) / Q)

τ² is estimated by restricted maximum likelihood (REML, iterated to convergence; Viechtbauer, 2005) or by the DerSimonian–Laird method of moments. The Hartung–Knapp–Sidik–Jonkman option rescales the standard error by the weighted residual variance and uses a t distribution with k − 1 degrees of freedom, which keeps coverage closer to 95% when there are few studies (IntHout et al., 2014). The 95% prediction interval is:

μ̂ ± tk−2 × √(τ² + SE(μ̂)²)

Standardized mean differences use Hedges’ g with the exact small-sample correction and variance 1/n₁ + 1/n₂ + g² / (2(n₁ + n₂)). Pooled results for ratios are back-transformed with the exponential function before display.

Worked example: BCG vaccine trials

The tool opens with the 13 BCG vaccine trials summarised by Colditz et al. (1994), a standard teaching dataset: tuberculosis cases and group sizes in vaccinated and unvaccinated participants. Each row below is calculated with the same code as the forest plot maker.

Pooled risk ratio for the BCG vaccine trials under each model
ModelPooled RR (95% CI)log RR (SE)τ²95% prediction interval
Fixed effect0.65 (0.60 to 0.70)−0.4303 (0.0405)——
Random effects, DerSimonian–Laird0.49 (0.34 to 0.70)−0.7141 (0.1787)0.30880.14 to 1.77
Random effects, REML0.49 (0.34 to 0.70)−0.7145 (0.1798)0.31320.13 to 1.78
Random effects, REML + HKSJ0.49 (0.33 to 0.73)−0.7145 (0.1808)0.31320.13 to 1.78

With REML random effects, the pooled risk ratio is 0.49 (95% CI 0.34 to 0.70; p < 0.001), about a 51% lower risk of tuberculosis on average. But heterogeneity is very high (I² = 92%, Q = 152.23 on 12 df), and the prediction interval runs from 0.13 to 1.78, so the vaccine’s effect in a new setting could plausibly range from strong protection to none. These figures agree with the published output of the R package metafor for this dataset (log RR −0.7145, τ² 0.3132 with REML).

Forest plots in R, Stata, RevMan, Excel and Python

  • R. The metafor and meta packages draw forest plots with forest(). Open “R code to reproduce this plot” below the figure to get a script with your data, model and estimator already filled in.
  • Stata. The meta suite (meta set, meta summarize, meta forestplot) and the community metan command both produce forest plots; set the estimator explicitly because defaults vary between versions.
  • RevMan. Cochrane’s Review Manager draws forest plots for intervention reviews and uses Mantel–Haenszel weighting for binary data by default, so its results can differ slightly from inverse-variance pooling.
  • Excel. Excel has no forest plot chart. You can imitate one with a scatter chart, custom horizontal error bars and a logarithmic axis, but you must calculate weights, pooled effects and I² yourself. Entering the same rows here is quicker, and you can paste straight from a spreadsheet.
  • Python. Packages built on matplotlib can draw a forest plot from estimates and intervals, but pooling and heterogeneity statistics usually need a separate meta-analysis library.

Forest plots of odds ratios and hazard ratios without pooling

Forest plots are also used outside meta-analysis: to show adjusted odds ratios from a logistic regression, hazard ratios from a Cox model, or treatment effects in subgroups of a single trial. Choose “Effect + CI”, select the measure, and set pooling to “None”. The plot keeps the log axis and line of no effect but draws no diamond, because estimates from one model or overlapping participants must not be pooled.

Assumptions and limitations

  • Inverse-variance methods only. Mantel–Haenszel and Peto odds ratios, which handle sparse binary data better, are not offered.
  • Entered intervals are taken as 95% Wald intervals, symmetric on the log scale for ratios and on the original scale for differences. Rounded confidence limits in published papers make recovered standard errors slightly approximate.
  • Zero cells. 0.5 is added to every cell of a study with a zero cell; studies with no events in either group are excluded from ratio measures.
  • One analysis per plot. Subgroup analyses, meta-regression, funnel plots and tests for publication bias are not included. Draw each subgroup as its own plot and test differences with dedicated software.
  • Few studies. With fewer than about five studies, τ² is estimated imprecisely; the Hartung–Knapp interval and the prediction interval will be wide, and that width is honest.
  • A statistical summary is not a judgement of the evidence. Risk of bias, certainty of evidence (for example GRADE) and whether pooling is appropriate at all still need to be assessed.

Reporting the forest plot

PRISMA 2020 asks reviews to present, for each study, summary statistics for each group and an effect estimate with its precision, ideally in a structured table or plot, and for each meta-analysis the summary estimate, its precision and measures of heterogeneity. A forest plot with the methods text from this tool covers the figure and most of that statement: name the effect measure, model, τ² estimator and interval method in your methods section.

Document study selection with our PRISMA flow diagram generator, and see the guides to PRISMA 2020 reporting and meta-analysis versus systematic review. When the review is ready, use the journal search to compare where to submit it.

Frequently asked questions

How do I make a forest plot online for free?
Choose how your data are reported (2×2 counts, mean & SD, or effect + CI), pick the effect measure, then type or paste one row per study. The forest plot and pooled result update as you type. Set the labels either side of the line of no effect, then download the figure as a PNG for a manuscript or an SVG for further editing. There is no account, watermark or study limit.
What data do I need to make a forest plot?
For each study you need either the number of events and the total in each group (for odds ratios, risk ratios and risk differences), the mean, standard deviation and sample size in each group (for mean differences and standardized mean differences), or an effect estimate with its lower and upper 95% confidence limits (for hazard ratios, adjusted odds ratios and any other measure). A study label, such as first author and year, is shown on the left of the plot.
Can I make a forest plot from odds ratios and 95% confidence intervals?
Yes. Choose "Effect + CI" and enter each odds ratio with its lower and upper limits. For ratio measures the standard error is recovered on the log scale as (ln upper − ln lower) / (2 × 1.96), which assumes the interval was symmetric on that scale, as Wald intervals from logistic and Cox regression are. The same works for hazard ratios and risk ratios. For mean differences the interval is used on its original scale.
Should I use a fixed-effect or random-effects model?
A fixed-effect (common-effect) model assumes every study estimates the same true effect, and differences between them are only sampling error. A random-effects model assumes the true effects vary between studies and estimates the average of that distribution. When studies differ in population, dose or setting, random effects is usually the better description; decide before you see the results and state the choice in your protocol. This tool defaults to random effects with REML, the estimator the Cochrane Handbook now prefers over DerSimonian–Laird, and offers the Hartung–Knapp (HKSJ) interval.
What do the squares, lines and diamond on a forest plot mean?
Each square is one study’s point estimate, and its size is proportional to the study’s weight in the pooled analysis. The horizontal line through it is the study’s 95% confidence interval. The vertical line is the line of no effect: 1 for ratios and 0 for differences. The diamond is the pooled estimate: its centre is the pooled effect and its left and right points are the 95% confidence interval. A bar below the diamond, if shown, is the 95% prediction interval for the effect in a new study.
What is I² and how is heterogeneity calculated?
Cochran’s Q is the weighted sum of squared differences between each study’s effect and the fixed-effect pooled effect. I² = (Q − df) / Q, set to 0 when Q is below its degrees of freedom, is the percentage of variability in effect estimates that is due to heterogeneity rather than chance. τ² is the estimated variance of the true effects between studies, on the analysis scale. I² depends on study precision, so report τ² and a prediction interval alongside it rather than labelling heterogeneity from I² alone.
What is a prediction interval in a meta-analysis?
The 95% prediction interval estimates where the true effect of a new, similar study is likely to fall, allowing for between-study variance. It is wider than the confidence interval of the pooled effect, which only describes the uncertainty in the average. This tool calculates it as the pooled effect ± t(k − 2) × √(τ² + SE²), following Higgins, Thompson and Spiegelhalter (2009), and needs at least three studies.
How are studies with zero events handled?
If any cell of a study’s 2×2 table is zero, 0.5 is added to all four cells of that study so its odds ratio or risk ratio and variance can be calculated. A study with no events in both groups (or all participants with events in both groups) carries no information on a ratio scale and is left out, with a note; it is kept for a risk difference. With many zero-event studies, Mantel–Haenszel or Peto methods in dedicated software are more appropriate.
Can I make a forest plot of odds ratios from a logistic regression?
Yes. Choose "Effect + CI", the odds ratio measure and "None" for pooling, then enter one row per variable with its adjusted odds ratio and confidence interval. The tool draws the estimates on a log axis without a pooled diamond, which is the usual figure for regression results and for subgroup hazard ratios from a single trial. Do not pool estimates that come from the same model or the same participants.
How do I make a forest plot in R, Excel or RevMan instead?
Below the plot, the tool writes R code for the metafor package that reproduces your data, model and figure, so you can rerun the analysis in a script. In Excel a forest plot has to be built by hand from a scatter chart with custom error bars and a logarithmic axis, and Excel does not pool studies or calculate I². RevMan, Stata (meta forestplot) and Comprehensive Meta-Analysis also draw forest plots; check which estimator and interval method each uses, because defaults differ.
Why do my results differ slightly from RevMan or other software?
Common reasons are a different τ² estimator (REML versus DerSimonian–Laird), Mantel–Haenszel instead of inverse-variance weighting for binary data, a different continuity correction for zero cells, the Hartung–Knapp adjustment, an approximate rather than exact Hedges’ g correction, or rounding of the entered confidence limits. For the BCG vaccine example on this page, the fixed-effect, DerSimonian–Laird and REML results match those published for the metafor package to four decimals.
Can I use the forest plot in a journal article, and is my data stored?
Yes. The figure is yours to use without attribution, and the PNG is exported at three times screen resolution, about 300 dpi at a typical figure width; the SVG is a vector file you can edit in Illustrator or Inkscape. Check your target journal’s figure requirements. Your data are processed only in your browser: nothing is uploaded, saved or put into the page address, so download the CSV if you want to continue later.

Sources

Content updated October 26, 2026. The hazard ratio, mean and regression examples in the tool are illustrative and use no real study data.