How to Merge CSV Files
- Select or drag in all the CSV files you want to combine. You can add more from other folders afterwards.
- Check the column notice. If some files have different columns, keep By column name selected.
- Optionally tick Add a source_file column to record where each row came from.
- Press Merge Files and download the merged CSV.
Matching Columns by Name
Exports from the same system are rarely identical over time. A column gets added in March, two columns swap places after a software update, or one store's export has an extra field. Pasting such files together lines values up under the wrong headings without any warning. Matching by name avoids that:
| File | Header |
|---|---|
january.csv | id, name |
february.csv | name, id, email |
| Merged result | id, name, email — January's rows have an empty email |
Names are compared after removing spaces at the start and end, so email and email count as the same column. Choose By position only when your files have no reliable header, or the headers are spelled differently but the columns are known to be in the same order.
Other Ways to Merge CSV Files, and Their Catches
On Windows, copy *.csv merged.csv in Command Prompt joins files byte by byte. It is fast, but it repeats every file's header row inside the data, can glue the last row of one file onto the first row of the next when a file does not end with a line break, and ignores column order entirely. We ran it and the other usual commands on test files in merging CSV files from the command line. Excel's Power Query can combine a folder of files properly, but the result still has to fit in 1,048,576 rows if you load it into a sheet.
This tool reads each file in small pieces and writes one merged file straight to your disk, so the combined result can be far larger than Excel could open. When all files share the same header and delimiter, rows are copied through exactly as they are, including quotes and leading zeros.
Last updated .