Merge several CSV files into one

Stack the rows of two or more CSV files into a single file. Columns can be matched by name, so files with the same headers in a different order still line up, or by position. An optional column records the source file of each row.

CSV Merger tool

Your file stays in this browser tab. It is not uploaded by SheetShift.

CSV files (select two or more)

Drag a file here, or

Options

How to use the CSV Merger

  1. Select two or more CSV files at once, or add them one at a time. You can also paste text for each file.
  2. Match by header name when the files share column names. Missing columns are left empty in the rows that lack them.
  3. Tick "Add a source_file column" to keep track of where each row came from.
  4. Press Merge and download the combined file.

Example: input and output

This example was produced by the same code the tool runs, with these settings: mode = header, addSource = true. You can download the sample file(s): jan.csv, feb.csv.

Input
# jan.csv
date,region,sales
2026-01-05,North,1200
2026-01-09,South,950

# feb.csv
sales,date,region,discount
1100,2026-02-03,North,5
870,2026-02-11,South,0
Output
date,region,sales,discount,source_file
2026-01-05,North,1200,,jan.csv
2026-01-09,South,950,,jan.csv
2026-02-03,North,1100,5,feb.csv
2026-02-11,South,870,0,feb.csv

Result summary: Merged 2 files into 4 rows.

Supported formats

CSV, TSV, TXT. Files may use different delimiters; each one is detected separately.

Limitations

  • Header matching ignores case and surrounding spaces. Two columns that differ only by case are treated as one.
  • Position matching assumes every file has the same column order. Files with fewer columns are padded; extra columns beyond the first file are dropped and you get a warning.
  • This tool stacks rows. It does not join tables on a key.

When this helps

Monthly exports

Twelve monthly sales files with the same columns become one yearly file ready for a pivot.

Files from different tools

Exports where one tool added an extra column still merge cleanly by header.

Frequently asked questions

Do the files need the same columns?

Not with header matching. The result has every column found in any file, and cells are empty where a file had no such column.

Is the order of rows kept?

Yes, files are added in the order listed, and rows keep their order inside each file.

Can I merge Excel files?

Convert each sheet with the Excel to CSV tool first, then merge the CSV files here.

Related tools

Category: CSV Tools