Merge CSV Files Online

Drop several CSV files and get one back. Columns are matched by header name rather than by position, so files that agree on their columns but not on their order still merge correctly.

Input

Drop two or more CSV files here, or use the button above.

Read on this page. Nothing is uploaded.

Edit
Paste or upload something above and it will appear here.

Matching by name, not position

Stacking files by position is what a shell cat does, and it is wrong the moment two exports put their columns in a different order. Matching by header name means a file with columns id, name, total merges correctly with one that has name, total, id.

A column present in some files and not others becomes a column that is empty for the rows that came from the files without it. That is more useful than refusing to merge, and it is visible in the result rather than silent.

Before you merge

Check that the header names really do mean the same thing. Two exports can both have a column called date where one is the order date and one is the ship date. Nothing here can detect that, and merging them produces a file that is wrong in a way that is hard to spot later.

Questions

What happens to duplicate rows?

They are kept. Run Deduplicate in the editor afterwards if you want them gone, so that removing rows is a decision you made rather than something that happened to you.

Do the files need the same columns?

No. Columns are unioned across all the files. A column that only some files have is present in the result and empty for rows from the files that lacked it.

Other tools