Account

What new tool do you want?

Office & Documents

Merge CSV Files (Append or Join)

Combine two CSV files — stack rows (matching columns by header name) or join them on a shared key column like a VLOOKUP.

How to use

  1. 1Paste the first CSV on the left and the second on the right (both with headers).
  2. 2Choose Append to stack rows, or Join and enter the shared column name.

How it's calculated

Append: columns are matched by header name; missing columns are left blank. Join (left join): every row of the first file gets the matching columns from the second file where the key values are equal.

Frequently asked questions

What if the files have different columns?

Append creates the union of all columns and leaves blanks where a file doesn't have that column.

What happens to rows with no match in a join?

They're kept with empty values for the second file's columns (a left join), just like VLOOKUP returning blank.

Can I merge more than two files?

Yes — merge two, then paste the result on the left and the next file on the right.

Append and Join solve opposite problems

Append is for two files describing the same kind of thing — this month's signups and last month's — and stacks them into one list, building the union of every column it sees and leaving a blank wherever one file lacked that column. Join is for two files describing different things about the same key — a customer list and an order list sharing a customer ID — and adds columns instead of rows.

Join is a left join, with VLOOKUP's exact blind spot

Every row from the first file is kept even if the key has no match in the second file; the second file's columns are just left blank, exactly like VLOOKUP returning blank for a missing match. Rows that exist only in the second file disappear from the merged output entirely rather than appearing as new rows — worth knowing before assuming the merge captured everything from both sides.

A worked example: the same two files, two different results

Left file id,name with rows 1-Alice and 2-Bob; right file id,city with rows 1-Paris and 3-Rome. Append stacks both files under a combined id,name,city header, producing four rows — Alice and Bob with blank cities, Paris and Rome with blank names — because it doesn't try to match anything, just stack. Join on id instead produces two rows: Alice paired with Paris (id 1 matches on both sides), and Bob with a blank city (id 2 has no match in the second file) — while Rome (id 3) is dropped entirely, since it has no row in the first file to attach to.

Append is selected, and the sample key is id even before I join

The mode opens on Append rows. The key box stays hidden until I choose Join, and then it already says id. In append, columns are lined up by header name and a column that exists in only one file is left blank on the other file's rows. Join is the other choice, and it keeps every row of the first file, adding fields from the second only where that key matches. If either file is missing the key column I named, I get a message that both files need that column. The summary reports how many rows and columns came out. Matching on the key is exact, so 01 and 1 do not meet.

Related tools

More: Office & Documents