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
| Option | One header | Match by name | Source column | Large files | Data uploaded |
|---|---|---|---|---|---|
| Windows `copy *.csv` | No | No | No | Yes | No |
| Mac/Linux `awk` | Yes | No | With a tweak | Yes | No |
| PowerShell Import-Csv/Export-Csv | Yes | Partly | With a tweak | Medium | No |
| csvkit `csvstack` | Yes | Yes | Yes (-n) | Medium | No |
| Python pandas | Yes | Yes | Yes | Yes | No |
| Excel Power Query | Yes | Yes | Yes | Up to Excel's row limit (more in Data Model) | No |
| Google Sheets (import + VSTACK) | Manual | No | Manual | 10 million cells per file | Stored in Google Drive |
| Typical online merger | Usually | Varies | Varies | Upload limits | Yes |
| Analistable CSV combiner | Yes | Yes | Yes | Limited by browser memory | No |
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 -NoTypeInformationPowerShell 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.