DEV-004
CSV Merger
Combining CSV files is easy when every file has the same columns in the same order, and quietly dangerous when it does not. Pasting one file under another with a different column order puts phone numbers in the postcode column and nothing warns you. This tool makes you choose what should happen, and tells you what it did.
- Free
- No signup
- Private · runs locally
Your files are read and combined in your browser and are never uploaded.
How to merge CSV files
- Drop two or more CSV files onto the upload area. Each one is listed with its row and column count.
- Choose what should happen when the columns do not match.
- Optionally add a column recording which file each row came from.
- Download the merged file.
The three ways to handle mismatched columns
Matching is by column name, not by position, which is what makes the union and intersection options safe. A file whose columns are in a different order still lines up correctly.
| Option | What it does | Choose it when |
|---|---|---|
| Require matching headers | Refuses to merge unless every file has identical columns | The files should be identical and you want to be told if they are not |
| Keep every column | Takes the union. Rows from a file missing a column get a blank there | The files are related but some have extra fields |
| Keep only shared columns | Takes the intersection and drops the rest, listing what went | You only need the fields every file has |
What a careless merge gets wrong
Three things break most hand-rolled merges, and all three are handled here. The header row of the second and later files must not become a data row. A field containing a comma is wrapped in quotes and must stay wrapped. A field containing a line break is legal inside quotes and must not be treated as the end of the record.
The merged file is written with a byte order mark, because without one Excel on Windows reads UTF-8 as the local code page and turns every accented name into unreadable characters.
Frequently asked questions
Are my files uploaded?
No. They are read and combined in your browser. Nothing is transmitted, which matters when the files hold customer or employee data.
How large a file can I merge?
Up to 50 MB per file, which is roughly half a million rows of typical data. The limit exists because everything is held in memory while it is combined.
Does it remove duplicate rows?
No, it combines without judging the contents. For deduplicating a list of email addresses, use the CSV email list cleaner instead.
What about semicolon separated files?
They are detected automatically, which covers exports from European versions of Excel. You can choose the separator for the saved file independently.
Will the merged file open correctly in Excel?
Yes. It is written as RFC 4180 CSV with a byte order mark so that accented characters survive, which is the usual complaint about CSV files and Excel.
Read more
Background on when and why to use this.
Related tools
Other tools people use alongside the Merge CSV.
- DEV-005CSV Column MergerCombine two or more columns into one, such as first and last name.Open
- DEV-006CSV Email List CleanerRemove duplicates, catch provider typos, flag disposable and role addresses, review every change, and download a clean CSV with all your columns intact.Open
- DEV-001JSON FormatterFormat, minify and validate JSON with clear error messages.Open
Browse all developer tools or see every tool.