All posts
Guide7 min read

How to Join Two CSV Files on a Shared Key — Without Excel or SQL

Combine two CSV files into one by matching rows on a shared key column — the browser equivalent of a VLOOKUP or a SQL join. No formulas, no database, no upload. A step-by-step guide with inner, left, right, and outer joins explained.

You have two CSVs that describe the same things from different angles: one file of customers and one file of orders, or a product list and a price list, or last month's users and this month's activity. Each row in one file corresponds to a row in the other by a shared value — customer_id, email, SKU. What you want is a single table where each row carries the columns from both files. In a spreadsheet you'd reach for VLOOKUP; in a database you'd write a JOIN. Both work, and both are more setup than the job deserves when you just have two files sitting in a folder.

Short answer: open csvdiff.app/join-csv-files, drop both CSV or JSON files in, pick the column they have in common, and you get one combined table — a SQL-style join that runs entirely in your browser. Choose inner, left, right, or outer to decide what happens to rows that only exist in one file, then filter and export the result as CSV or JSON. Nothing is uploaded.

What "joining" Two CSVs Actually Means

A join lines up the rows of two tables by a shared key and stitches their columns together. If customers.csv has customer_id and name, and orders.csv has customer_id and total, joining them on customer_id produces a table with customer_id, name, and total — each order row now carries the customer's name. The key column is the hinge: it tells the join which row on the left belongs with which row on the right, regardless of the order the two files happen to be in.

Join on keycustomer_id
customers.csv
customer_idnameplan
C-18Adapro
C-22Bolafree
C-31Chenteam
+
orders.csv
customer_idtotal
C-18$240
C-22$90
C-31$610
=
joined.csv
customer_idnameplantotal
C-18Adapro$240
C-22Bolafree$90
C-31Chenteam$610
Joining on customer_id: each row from orders.csv gains the matching customer’s columns from customers.csv. The key column (highlighted) is the hinge that pairs the rows.

Inner, Left, Right, and Outer — What Happens to Unmatched Rows

The interesting part of any join is not the rows that match — it is the rows that do not. A customer with no orders, or an order whose customer_id is missing from the customer file, has to go somewhere. The join type is how you decide:

  • Inner join — keep only rows that match on both sides. The cleanest result, but silently drops anything unmatched, so use it when you expect every key to exist in both files.
  • Left join — keep every row from the first file; fill blanks where the second file has no match. Use it to enrich a primary list (all customers, plus order data where it exists).
  • Right join — the mirror of a left join: keep every row from the second file.
  • Outer join — keep everything from both files, matched or not. This is the one that surfaces the orphans: customers with no orders and orders with no customer, all in one table.

A VLOOKUP in a spreadsheet is effectively a left join — but it fails quietly. It returns the first match for a duplicate key with no warning, and turns unmatched rows into #N/A that you then have to wrap in IFERROR everywhere downstream. A real join makes the unmatched rows explicit instead of hiding them in an error value, which is usually the whole reason you were comparing the files in the first place.

Join two CSV files on a shared key right now — pick the key, choose the join type, and export the combined table. It runs entirely in your browser; nothing is uploaded.

Open the CSV join tool

Why Do It in the Browser Instead of Excel or a Database

The spreadsheet route means importing both files as tabs, hand-writing VLOOKUP or QUERY formulas across every column you want to carry over, copying them down every row, and debugging the #N/A and duplicate-key surprises. The database route means standing up a table, importing both CSVs, writing SQL, and exporting the result — overkill for two files you'll join once. Doing it in the browser skips both: the parsing, the join, the filtering, and the export all happen client-side in one tab. Because nothing is uploaded, it is safe for the kind of data that usually makes joining two exports awkward — customer PII, financial records, health data.

Step by Step

  • Open the join tool and drop both files in — each opens as its own tab. CSV and JSON both work, and you can mix them.
  • Start a join and pick the two datasets plus the column they share (for example customer_id or email).
  • Choose the join type — inner to keep only matches, or left/right/outer to keep and surface unmatched rows.
  • Review the combined table: filter it, sort it, hide columns, or show only the unmatched rows to audit what did not line up.
  • Export the result as CSV or JSON, with the encoding of your choice.

If the two files are versions of the same dataset and you care about what changed rather than how they combine — modified, added, and removed rows — that is a diff, not a join. The CSV diff tool is built for that case, and to view or clean a single file first, the CSV viewer handles it. Same parsing engine, same privacy guarantee, no upload in any of them.

Comparing two versions of the same file instead of combining different ones? See exactly what changed — modified, added, and removed rows — with a key-matched diff.

Open the CSV diff tool

Ready to combine your files? Open the join tool, match on a key, and export the joined CSV in the same tab.

Open the CSV join tool

Frequently asked questions

How do I join two CSV files online?+

Open the csvdiff.app join tool, drop both CSV or JSON files in, and pick the column they have in common (for example customer_id or email). The tool matches rows on that key and builds one combined table you can filter and export. It runs entirely in your browser — nothing is uploaded.

Is joining CSVs the same as a VLOOKUP?+

It achieves the same result — pulling columns from a second file into the first by a matching key — but without hand-writing formulas. A VLOOKUP is roughly a left join, and it fails quietly on duplicate keys and missing rows. A real join lets you choose inner, left, right, or outer and makes the unmatched rows explicit instead of returning #N/A.

What is the difference between a join and a diff?+

A join combines two files that describe different things (customers + orders) into one wider table by a shared key. A diff compares two versions of the same dataset and shows what changed — modified, added, and removed rows. Use the join tool to combine, and the CSV diff tool to compare.

Can I join a CSV with a JSON file?+

Yes. JSON arrays are flattened into a tabular view, so you can open a CSV and a JSON file in the same workspace and join them on a shared column, then export the combined result as either format.

Is my data uploaded when I join files?+

No. Parsing, joining, filtering, and export all happen client-side in your browser tab — the file contents never leave your machine. That makes it safe for sensitive data such as PII, financial records, or health information.

Try it yourself

Ready to diff your files?

Upload two CSV files and see the differences in seconds. 100% client-side — your data never leaves the browser.

Start comparing →
100% in your browser

Ready to diff?

Drop your files, see the deltas, export the merge. Takes 30 seconds.