# Venn diagram and UpSet plot maker

> Paste gene lists to make area-proportional Venn diagrams (2–3 sets), 4- and 5-set Venn diagrams or UpSet plots, with the members of every overlap. SVG and PNG.

URL: https://www.labcanvas.com/tools/venn-diagram-maker

Paste two or more lists, such as gene names or IDs, or type the set sizes and overlaps, and the tool draws a Venn diagram and lists the members of every overlap. Two sets get circles with exactly proportional areas; three sets get the best-fitting circles, with the fit error reported; four and five sets get the classic ellipse diagrams with every region; any number of sets can be shown as an UpSet plot. Download SVG or PNG at 150–600 dpi, the intersections as CSV, or open the diagram in the LabCanvas editor as editable vectors.

## Quick answer

- **What it does:** Counts every intersection of 2 or more lists, draws an area-proportional Venn diagram (2–3 sets), a classic 4- or 5-set Venn diagram or an UpSet plot, and lists the members of each region.
- **Formula:** Circle areas πr² = set sizes; the overlap of two circles with centres d apart is A = r₁² arccos((d² + r₁² − r₂²)/(2dr₁)) + r₂² arccos((d² + r₂² − r₁²)/(2dr₂)) − ½√((−d + r₁ + r₂)(d + r₁ − r₂)(d − r₁ + r₂)(d + r₁ + r₂)), solved for d.
- **Example:** Lists of 40 and 34 genes sharing 25: r₁ = √(40/π) = 3.568, r₂ = √(34/π) = 3.290, and the lens area equals 25 when the centres are d = 1.746 apart (same units).

Free, in the browser, no account needed. Updated 2026-10-19.

## Features

- Paste 2 to 16 lists (one item per line or comma-separated), upload a CSV or TSV with one column per set, paste a table from Excel, or type the counts for 2–3 sets
- Reads a 0/1 membership matrix too (UpSetR’s input format)
- Two sets: circles with exactly proportional areas, from the lens-area equation
- Three sets: best-fitting circles by least squares on the seven region areas (as eulerr and venneuler do), with the stress and largest region error reported, or a classic equal-circle layout
- Four sets: Venn’s four-ellipse diagram; five sets: Grünbaum’s symmetric five-ellipse diagram, every region labelled
- UpSet plot for any number of sets: intersection bars sorted by size, degree or sets, set-size bars, dot matrix; hide empty intersections, set a minimum size
- Counts, percentages or both in the regions; colour-blind-safe palettes (Okabe–Ito, Paul Tol), greys for print, adjustable opacity
- Table of the members of every intersection, exclusive (Venn regions) or inclusive; copy it, or download CSV, a by-column CSV or a membership matrix
- SVG, PNG at 150, 300 or 600 dpi, or open it in the LabCanvas figure editor as editable vectors
- Runs in your browser: your lists are not uploaded

## How to use it

1. **Paste the lists**: Name each set and paste its items, or upload a CSV with one column per set. Use “Counts” if you only have the numbers.
2. **Choose the diagram**: For 2–3 sets choose area-proportional or classic circles; 4–5 sets get ellipses; switch to an UpSet plot for many sets or to read sizes accurately.
3. **Export or edit**: Download SVG or PNG, copy the members of each intersection, or open the diagram in the LabCanvas editor to finish the figure.

## At a glance

| | |
| --- | --- |
| Input | 2–16 lists (pasted, CSV/TSV upload, Excel table or 0/1 matrix), or sizes and overlaps for 2–3 sets |
| Venn diagrams | 2 sets: exact proportional circles; 3 sets: least-squares circle fit with stress and diagError, or classic; 4–5 sets: classic ellipses |
| UpSet plot | Any number of sets; sort by size, degree or sets; exclusive or inclusive counts; hide empty, minimum size |
| Intersections | Members of every region, exclusive or inclusive; CSV, by-column CSV, membership matrix |
| Export | SVG, PNG at 150–600 dpi, or editable vectors in the LabCanvas editor |

## How it works

**Counting.** Each item is matched across lists (after trimming spaces; duplicates within a list count once; optionally ignoring case) and given the set of lists it appears in. The *exclusive* count of a combination, such as “A ∩ B only”, is the number of items in exactly those lists; these are the regions a Venn diagram draws, and they add up to the number of unique items. The *inclusive* count, \(\lvert A \cap B \rvert\), also includes items that are in further lists. The two are linked by inclusion–exclusion: for three sets, A ∩ B only \(= \lvert A \cap B \rvert - \lvert A \cap B \cap C \rvert\), and A only \(= \lvert A \rvert - \lvert A \cap B \rvert - \lvert A \cap C \rvert + \lvert A \cap B \cap C \rvert\). When you type sizes and overlaps, the tool uses these to find the regions and rejects numbers that would make a region negative.

**Two sets, exactly.** Each circle’s area equals its set size, \(\pi r_i^2 = \lvert S_i \rvert\). The overlap of two circles whose centres are \(d\) apart is the lens \(A_\cap(d) = r_1^2 \arccos\frac{d^2 + r_1^2 - r_2^2}{2 d r_1}\) \(+\, r_2^2 \arccos\frac{d^2 + r_2^2 - r_1^2}{2 d r_2}\) \(-\, \tfrac{1}{2}\sqrt{k}\), where \(k = (-d + r_1 + r_2)\) \(\times (d + r_1 - r_2)\) \(\times (d - r_1 + r_2)\) \(\times (d + r_1 + r_2)\). The lens area falls steadily from the smaller circle’s area at \(d = \lvert r_1 - r_2 \rvert\) to 0 at \(d = r_1 + r_2\). Bisection finds the \(d\) where it equals the shared count, so all three regions have exactly the right areas.

**Three sets, by fitting.** Three circles have six free numbers once position and rotation are fixed (three radii and three distances) but seven regions to match, so most data cannot be drawn exactly with circles (Chen and Boutros 2011; Micallef and Rodgers 2014). Following eulerr (Larsson and Gustafsson 2018) and venneuler (Wilkinson 2012), the tool starts from the distances that give each pair its overlap, then adjusts the radii and centres to minimise the sum of squared differences between drawn and wanted region areas, \(\sum_r (\hat{a}_r - a_r)^2\), with Nelder–Mead from several starts. Region areas are computed exactly from the circle geometry (polygon plus circular segments). It then reports two measures: **stress**, \(\sum_r (a_r - \beta \hat{a}_r)^2 / \sum_r a_r^2\) with \(\beta\) the least-squares scale (venneuler’s measure; 0 is perfect), and **diagError**, the largest difference between a region’s share of the drawing and its share of the items (eulerAPE and eulerr’s measure). A region that the circles cannot show at all is listed under the diagram, never silently dropped.

**Classic layouts.** The non-proportional option uses equal circles for 2–3 sets, Venn’s arrangement of four ellipses for 4 sets and Grünbaum’s (1975) five congruent ellipses with five-fold symmetry for 5 sets, so every one of the 3, 7, 15 or 31 regions exists. Each count is written at the point of its region farthest from any edge. With six or more sets no ellipse Venn diagram exists, and UpSet plots are clearer anyway.

**UpSet plots** (Lex et al. 2014; Conway et al. 2017) show each intersection as a column: a bar for its size above, and below it a matrix whose filled dots mark the sets involved, joined by a line. Horizontal bars give each set’s size. By default the bars are exclusive counts, as in UpSetR, so every item is counted once; inclusive counts are an option.

Sources: Lex A, Gehlenborg N, Strobelt H, Vuillemot R, Pfister H. UpSet: visualization of intersecting sets. *IEEE Trans Vis Comput Graph* 2014;20:1983–1992, [doi:10.1109/TVCG.2014.2346248](https://doi.org/10.1109/TVCG.2014.2346248). Conway JR, Lex A, Gehlenborg N. UpSetR: an R package for the visualization of intersecting sets and their properties. *Bioinformatics* 2017;33:2938–2940, [doi:10.1093/bioinformatics/btx364](https://doi.org/10.1093/bioinformatics/btx364). Wilkinson L. Exact and approximate area-proportional circular Venn and Euler diagrams. *IEEE Trans Vis Comput Graph* 2012;18:321–331, [doi:10.1109/TVCG.2011.56](https://doi.org/10.1109/TVCG.2011.56). Larsson J, Gustafsson P. A case study in fitting area-proportional Euler diagrams with ellipses using eulerr. *Proceedings of the International Workshop on Set Visualization and Reasoning* 2018, CEUR Workshop Proceedings 2116:84–91, [ceur-ws.org/Vol-2116/paper7.pdf](https://ceur-ws.org/Vol-2116/paper7.pdf). Micallef L, Rodgers P. eulerAPE: drawing area-proportional 3-Venn diagrams using ellipses. *PLoS ONE* 2014;9:e101717, [doi:10.1371/journal.pone.0101717](https://doi.org/10.1371/journal.pone.0101717). Chen H, Boutros PC. VennDiagram: a package for the generation of highly-customizable Venn and Euler diagrams in R. *BMC Bioinformatics* 2011;12:35, [doi:10.1186/1471-2105-12-35](https://doi.org/10.1186/1471-2105-12-35). Grünbaum B. Venn diagrams and independent families of sets. *Math Mag* 1975;48:12–23, [doi:10.1080/0025570X.1975.11976431](https://doi.org/10.1080/0025570X.1975.11976431).

## Worked example: three hypoxia gene lists

The built-in example is three illustrative lists from a hypoxia study: 40 genes up after 24 h of hypoxia, 34 HIF1A ChIP-seq targets and 38 proteins up by proteomics. The gene names are real; the lists are made up for the example.

- **Count the regions.** 64 genes are in at least one list. Exclusive counts: hypoxia only 10, ChIP only 5, proteomics only 15, hypoxia ∩ ChIP only 11, hypoxia ∩ proteomics only 5, ChIP ∩ proteomics only 4, all three 14. They add up to 64. Inclusive: hypoxia ∩ ChIP \(= 11 + 14 = 25\), hypoxia ∩ proteomics \(= 19\), ChIP ∩ proteomics \(= 18\).
- **Two circles exactly.** For hypoxia and ChIP alone, the radii are \(r_1 = \sqrt{40/\pi} = 3.568\) and \(r_2 = \sqrt{34/\pi} = 3.290\) (in units where the area is the gene count). The lens area is 25 at \(d = 1.746\): solving the lens equation by bisection gives that distance, and putting it back gives an overlap of 25.000.
- **Three circles by fitting.** The best circles give stress 0.0048 and diagError 2.0 percentage points. The largest error is ChIP ∩ proteomics only: 4 of 64 genes (6.3 %) but 4.3 % of the drawn area; hypoxia ∩ proteomics only gets 6.4 % for 7.8 %. All other regions are within 1.1 points. Fitting the same loss with SciPy gives the same stress; matplotlib-venn’s layouts give 0.0069 (cost-based) and 0.0057 (default).
- **Read the members.** The 14 genes in all three lists are *VEGFA, CA9, SLC2A1, PGK1, BNIP3, LDHA, NDRG1, P4HA1, ALDOA, ENO1, HK2, GPI, TPI1* and *PGAM1*, the core hypoxia-response genes. The exclusive table lists them once, under “all 3”; the inclusive row “Hypoxia ∩ HIF1A ChIP-seq” lists them again with the 11 genes that are only in those two lists.

| Sets | Best choice | Notes |
| --- | --- | --- |
| 2 | Area-proportional Venn | Always exact |
| 3 | Area-proportional Venn if the error is small; otherwise classic Venn or UpSet | Check the stress and diagError under the diagram |
| 4–5 | Classic ellipse Venn, or UpSet | Areas are not to scale; read the numbers |
| 6 or more | UpSet plot | Venn diagrams with every region become unreadable |

## Questions

### How do I make a Venn diagram from gene lists?

Paste each list (one gene per line or comma-separated) into its own box and name the sets. The diagram, the counts and the members of every overlap appear as you type. Download SVG or PNG, copy the table of intersections, or open the diagram in the LabCanvas editor.

### Why is my 3-set Venn diagram not exact?

Three circles cannot match seven region areas in general: once you fix the position and rotation, three circles have only six free numbers (three radii and three distances) for seven regions, and circles also force some regions to appear or vanish together. The tool finds the circles with the smallest squared area error and reports it as stress and diagError (the largest error in a region’s share). If the error is more than a few percentage points, read the numbers, switch to the classic layout, or use an UpSet plot. Ellipses can fit more data exactly (eulerAPE, eulerr).

### What is an area-proportional Venn diagram?

One where each region’s area is proportional to the number of items in it, also called a scaled or Euler diagram. For two sets this is always possible with circles; for three it is usually approximate.

### What is an UpSet plot?

A chart for set intersections (Lex et al. 2014): each column is one intersection, with a bar showing its size and dots below marking which sets it involves. It stays readable for many sets, where Venn diagrams fail, and its bars are easier to compare than Venn areas.

### How do I make a 4-set or 5-set Venn diagram?

Paste four or five lists. The tool draws Venn’s four-ellipse diagram or Grünbaum’s five-ellipse diagram, in which all 15 or 31 regions exist, and writes each count inside its region. These are not area-proportional; for sizes you can compare, use the UpSet plot.

### What is the difference between exclusive and inclusive intersections?

Exclusive (“A ∩ B only”) counts items in exactly those sets and no others: these are the regions of the Venn diagram and they add up to the total. Inclusive (\(A \cap B\)) counts every item in both A and B, including those also in C. The inclusive count of A ∩ B equals “A ∩ B only” plus “A ∩ B ∩ C”.

### How do I get the list of genes in an overlap?

The table under the diagram lists the members of every region. Switch between exclusive and inclusive, then copy it or download a CSV (one row per intersection, a CSV with one column per intersection, or a 0/1 membership matrix for R or Python).

### Can I make the diagram from numbers only?

Yes. Choose “Counts”, pick 2 or 3 sets, and type either the set sizes and overlaps (for example |A| = 120, |B| = 95, |A ∩ B| = 40) or the count of each region. The tool checks that the numbers are possible.

### Can I upload an Excel or CSV file?

Save the sheet as CSV (or copy the columns) with one column per set and the set names in the first row, then upload it or paste it into “Paste a table”. A 0/1 membership matrix with items in the first column also works.

### Is my data uploaded?

No. Lists are compared and diagrams drawn in your browser.
