Analistable

The best free ways to merge CSV files

By the Analistable team · Updated · 2 min read

The best free CSV merger depends on your files. For files with identical columns, a one-line command is fastest. For files with different columns or encodings, use Excel's Power Query or Python, which match headers by name. For a quick merge without installing anything, use a browser tool that runs locally so your data isn't uploaded.

Part of our guide: How to merge CSV files into one

What to look for

  • One header row in the output, not one per file.
  • Columns matched by name, so reordered or extra columns don't scramble the data.
  • A source column showing which file each row came from.
  • Encoding and delimiter control for exports from different systems.
  • Privacy: whether files are uploaded to a server.
  • Size: how many rows it can handle.

Comparison

Free CSV merging options
OptionOne headerMatch by nameSource columnLarge filesData uploaded
Windows `copy *.csv`NoNoNoYesNo
Mac/Linux `awk`YesNoWith a tweakYesNo
PowerShell Import-Csv/Export-CsvYesPartlyWith a tweakMediumNo
csvkit `csvstack`YesYesYes (-n)MediumNo
Python pandasYesYesYesYesNo
Excel Power QueryYesYesYesUp to Excel's row limit (more in Data Model)No
Google Sheets (import + VSTACK)ManualNoManual10 million cells per fileStored in Google Drive
Typical online mergerUsuallyVariesVariesUpload limitsYes
Analistable CSV combinerYesYesYesLimited by browser memoryNo

Command line

Fastest for many files with identical columns. Mac and Linux: see combining CSV files on a Mac. Windows Command Prompt's copy *.csv all.csv repeats every header; PowerShell does better:

Get-ChildItem *.csv | ForEach-Object { Import-Csv $_ } | Export-Csv ..\combined.csv -NoTypeInformation

PowerShell uses the first file's columns for the output, so columns that only appear in later files are dropped.

csvkit and Python

csvstack -n source --filenames *.csv > combined.csv (csvkit, installed with pip install csvkit) stacks files and adds a source column. In Python, pd.concat(map(pd.read_csv, files)) matches columns by name. See merging data in pandas.

Excel and Google Sheets

Excel's Power Query is the most capable free option if you already have Excel: it handles encodings, delimiters and different columns, and refreshes. Details: combining CSV files in Excel. Google Sheets has no folder import, so you import each file and stack them with VSTACK — fine for a handful of files.

Online tools

Convenient, but most upload your files. Before using one with customer or financial data, check it — our guide to merging without uploading shows how in a minute. The Analistable CSV merger processes files in your browser.

Frequently asked questions

What is the easiest free way to merge CSV files?
A browser tool that keeps one header row is the easiest. For repeated merges, Excel's Power Query From Folder refreshes in one click.
Can I merge CSV files with different columns for free?
Yes, with Power Query, pandas, csvkit or a browser tool that matches columns by header name.
Is it safe to merge CSV files online?
Only if the tool doesn't upload your data, or the data isn't sensitive. Check the browser's Network tab while adding a test file.

Related guides