Venn Diagram from Lists
Operator: Abdulla Al Fahad. How tools are built and checked
Comparing lists by eye misses the people who are on exactly two of them, and a picture alone cannot tell you who they are. Each item here gets a membership mask, so every region of the diagram has an exact count and a sorted member list, and the circles are drawn from the same numbers.
Paste a list into each box, or load a CSV or XLSX and tick two to four columns, one per set. Clicking a region of the diagram, or its Members button in the table, shows who is in it, and the members and counts download as CSV.
Key features
- Two to four sets from pasted lines or from ticked CSV and XLSX columns, up to 50,000 lines each
- Optional trimming of spaces, case-insensitive matching and splitting on commas, semicolons and tabs
- Exact counts and members for every one of the 2^n - 1 regions, with duplicates inside a list counted once
- Circle areas that follow the set sizes for two and three sets, with pairwise overlaps sized to the pairwise counts
- A fixed ellipse layout for four sets in which all 15 regions exist
- Members CSV, region counts CSV, SVG and PNG; a highlighted region is left out of the exported picture
How overlaps are counted and how the circles are sized
An item is compared after trimming and, if you leave case-folding on, lower-casing, and the first spelling seen is the one shown. Blank lines are dropped. A region is an exact combination: 'A ∩ B only' means in A and B and in no other set, which is why the regions of the diagram add up to the number of distinct items.
For two circles the centre distance is found by bisection so that the lens-shaped overlap has the area of the A and B count. For three circles each pair is spaced from its pairwise count, counting the items that are in all three as part of every pair, and the third circle is placed by triangle geometry. The three-way region then falls where it falls: pair overlaps are exact, the centre region is not guaranteed to match its count in area. When the three pairwise counts cannot all be drawn with circles, for example A shares items with B and with C while B and C share none, the page keeps the A and B and the A and C overlaps exact on one line, so the B and C circles may touch a little and a region with count 0 may still show as a sliver. Sizes are always shown as numbers.
Lists are split on line breaks by default; with the split option on, commas, semicolons and tabs also separate items, which suits a pasted row of values and is wrong for names written as Smith, Ann.
How it works
Region labels are placed at the sampled point farthest from every outline, and a region too small for a number on the picture still appears in the table. Clicking maps the pointer to diagram coordinates and finds which circles or ellipses contain it.
The highlight is drawn as horizontal runs of 1.5 px samples of the exact region, not as a mask, so every browser and the SVG export draw it the same way.
Common use cases
- A marketer compares the webinar list with the customer list and finds 148 people on both and 612 on the webinar list only, then downloads the 612 as a CSV to target.
- A librarian loads two exports of 9,000 ISBNs each and trims spaces and folds case so that '978-0-…' typed with stray spaces still matches.
- A developer compares the permission names granted to four roles to see which are common to all and which belong to one role alone.
How to use this tool
- Paste one item per line into each set, or drop a CSV and tick the columns to compare.
- Decide whether differences in case or surrounding spaces should count, and read the counts in the region table.
- Click a region, or press its Members button, to list the items, then copy them.
- Download the members CSV for every region at once, or the region counts CSV for the numbers alone.
Example
Three lists (spaces trimmed, case ignored)
A: apple, Banana, cherry, " date ", elder, fig, apple
B: banana, cherry, grape, date, honey
C: cherry, fig, grape, kiwi, lemon, dateCounts
A has 6 distinct items (one apple was a repeat), B 5, C 6, and 10 distinct items overall. A only 2 (apple, elder), B only 1 (honey), C only 2 (kiwi, lemon), A and B only 1 (banana), A and C only 1 (fig), B and C only 1 (grape), all three 2 (cherry, date). With case-folding off, Banana and banana differ: A and B only drops to 0 and the total rises to 11.Common pitfalls
Four sets are not drawn to scale. The ellipses are a fixed arrangement that makes every region visible, so read the numbers, not the areas.
Matching is on the whole text of a line. 'Smith, Ann' and 'Ann Smith' are different items, and splitting on commas would also cut the first one in two, so leave that option off for names written surname first.
Only the first 50,000 lines of each list are compared and a notice says so when the cap is hit.
- Tick Ignore spaces when lists were typed by hand: a trailing space is the commonest reason that two apparently identical items refuse to match.
Common errors and how to fix them
- "Tick at least two columns."
- The Use these columns button needs two to four ticked headers. Tick another column and press it again; a fifth tick is ignored.
Best practices
- Name each set after its source, such as Webinar or Customers, because the names appear in the diagram, the region labels and every CSV row.
Reading region names
Every region is named by the sets it is exactly in. 'Newsletter ∩ Webinar only' means on both of those lists and not on Customers. The last region of each diagram is named '(all sets)'.
Frequently asked questions
Why does a circle look bigger than its count suggests?
Sizes are drawn from the area, so a circle of 100 is about 1.4 times the width of one of 50, not twice. Compare areas rather than diameters.
Can I compare more than four lists?
Not in one diagram here: five sets have 31 regions, which circles and the fixed four-ellipse layout used on this page cannot all show (five-set diagrams with other ellipse arrangements do exist). Compare in groups, or combine lists you want treated as one into a single column first.
What happens to an empty list?
It is drawn as a very small circle whose name shows a size of 0, and no region that includes it has members.