How to Merge CSV Files into One
To merge CSV files, add them to the list above, in the order you want the rows to appear. The tool reads each file, finds its header row, and writes one combined file with a single header followed by every data row. Nothing is copied by hand and nothing is uploaded. With two small files that hold the same columns in a different order, the result is:
id,name,city
1,Ada,Oslo
2,Linus,Bergen
3,Alan,Lyon
4,Grace,NiceThe first file has the columns id, name, city. The second has city, id, name. Because columns are matched by name, Alan lands under name and Lyon under city, not in the wrong columns. Merging by position would have mixed them up.
Combine CSV Files That Have Different Columns
Real files rarely match exactly. One export has an extra score column, another is missing city. When you combine CSV files by header name, the result gets the columns of all files, in the order they first appear. A file that lacks a column gets empty cells there. Merging id, name, city with id, name, score gives:
id,name,city,score
1,Ada,Oslo,
2,Linus,Bergen,
5,Edsger,,9The tool does not hide this. A note under the result says which file did not have every column, so a typo in a header shows up as a surprise extra column instead of staying unnoticed. Names are compared after trimming spaces, and with Ignore case in headers on, Name and name count as one column.
Append CSV Files by Position
Sometimes the files have the same layout but different header text, for example a column called Amount in one and Total in another. Choose By position and the files are stacked column by column. The header of the first file is kept and the header row of every other file is dropped. If a later header differs from the first, the tool tells you, because stacking by position trusts that the columns line up.
If the files have no header row at all, turn off First row is the header. Every row of every file is then kept, and rows that are shorter than the widest row are padded with empty cells.
Options for the Merged File
- Add source file column adds a last column called source_file with the name of the file each row came from. This is useful when you merge monthly exports and need to know which month a row belongs to.
- Remove duplicate rows keeps the first copy of every row that is identical in all columns. The source column is not part of that comparison, so the same row in two files counts as a duplicate.
- Skip empty rows leaves out rows where every cell is empty, such as blank lines at the end of an export. The status line says how many were skipped.
- Separator of the result is the same as the first file by default. Each input file is read with its own separator (comma, semicolon or tab), so you can merge files from different tools, and then pick one separator for the result.
- UTF-8 BOM for Excel adds a byte order mark to the downloaded file so that Excel reads accents, symbols and other alphabets correctly.
Quoted Fields, Line Breaks and Encoding
Cells that contain the separator, a double quote or a line break are quoted in CSV. The tool reads those correctly and writes them back the same way, so a cell like "a, b" stays one cell and a cell with a line break inside stays one cell. Line endings follow the first file: if it uses Windows line endings, so does the result.
Files are read as UTF-8, which is what most modern exports use. A byte order mark at the start of a file is removed so it does not end up inside the first header name. If a file was saved in an older encoding, such as Windows-1252, accented letters may look wrong. Re-save that file as UTF-8 first.
When Not to Use This Tool
This tool joins files end to end, so it adds rows. It does not join tables on a shared key the way a database or a VLOOKUP does. If you need to pull a column from one file into another by matching an id, that is a different job.
It reads text CSV, TSV and TXT files, not .xlsx workbooks. To get a sheet out of an Excel file first, use Excel to JSON or save the sheet as CSV from Excel. The whole set of files is held in your browser's memory, so the tool accepts up to 200 files and about 100 million characters in total. For files larger than that, merge them in smaller groups.
After You Merge: Where the CSV Goes Next
A merged CSV often goes into documentation or another format. CSV to Markdown Table turns it into a table for a README or wiki. If the data lives in a web page instead of a file, HTML Table to CSV gets it into CSV first, and you can merge the result with your other files here. For line-based data such as logs and exports, JSONL Viewer reads and converts JSON Lines files.
Privacy
Files are read and merged in your browser. They are not uploaded and they are not stored. See the Privacy Policy for details.