Skip to content
ToolPlankDEV
Text Tools
100% In-Browser Execution

Updated:

Merge CSV Files

Use this tool to merge CSV files into one. Add files or paste CSV, and columns are matched by header name, so files with different column order still line up. You get one header row, a warning for every mismatch and a file to download. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use Merge CSV Files

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Add your CSV files

    Drop the files on the box or press Add CSV files and pick several at once. You can also paste the contents of a file and press Add pasted CSV. Press Example to load three small files with different column orders.

  2. 02

    Put the files in order

    Each file shows its row count, column count and separator. The order of the list is the order of the rows in the result. Use the arrows to move a file up or down, or the bin to remove it.

  3. 03

    Choose how columns are matched

    By header name is the default: a column called city lines up with city in every file, wherever it sits. Choose By position if the files have the same layout but different headers, or turn off First row is the header if there are no headers at all.

  4. 04

    Check the notes, then copy or download

    The notes under the result list every mismatch the tool found. When they look right, press Copy CSV or Download to save merged.csv. Turn on UTF-8 BOM for Excel if accents look wrong when you open the file in Excel.

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:

Text
id,name,city
1,Ada,Oslo
2,Linus,Bergen
3,Alan,Lyon
4,Grace,Nice

The 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:

Text
id,name,city,score
1,Ada,Oslo,
2,Linus,Bergen,
5,Edsger,,9

The 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.

Frequently Asked Questions

Technical Q&A for Merge CSV Files

Common questions about edge cases, character encoding, and privacy guarantees.

Add the files to the tool, check their order and press Copy CSV or Download. The tool writes one header row followed by the rows of every file, in list order. Everything happens in your browser.

Drop all the files on the box at once, or pick several in the file window. Add as many as you need, up to 200, and download one merged.csv.

Yes. With By header name, the result has the columns of all files and gaps are left empty. A note lists each file that is missing a column.

Nothing breaks. Columns are matched by header name, so city is combined with city wherever it sits. The result uses the column order of the first file, followed by any new columns.

Turn off First row is the header. Every row of every file is kept and stacked by position, and shorter rows are padded with empty cells.

Yes. Turn on Add source file column and the last column of the result holds the file name of every row.

Only when you turn on Remove duplicate rows. It keeps the first copy of each row that is identical in all columns and shows how many were removed.

Yes. Each file is read with its own comma, semicolon or tab separator, and the result uses the separator you pick. A note appears if the files did not all match the first one.

Excel has no one-step merge for separate CSV files. You can open each file and copy its rows into one sheet, or use Power Query. This tool does the same job without a workbook, and its UTF-8 BOM option makes the result open correctly in Excel.

No. The files are read and merged in your browser and are not sent to a server or stored.