PrivateCSV

Merge CSV files into one

Combine several CSV files into one, with columns matched by name.

CSV files

  • Nothing is uploaded
  • Free · no account
  • Tested on 400k-row files

Reference

Merge CSV: how it works

The tool is above. Below: a short overview, optional step-by-step detail, honest browser limits, and answers to common questions.

Last updated 4 min read

About this tool

PrivateCSV merges CSV files online: it combines two or more CSV files into a single file with one header row. Columns are matched by name, so files whose columns are in a different order, or that have extra or missing columns, still line up. You can also add a source_file column that records which file each row came from. The merge runs in your browser and the files stay on your device.

How to check that your file is never uploaded

Guide: how to merge CSV files with Excel, the command line or Python

Read the step-by-step guideHow-to, example and use cases (~4 min)

How to merge CSV files

  1. Drop the CSV files on the picker, or click it and select several at once (hold Ctrl, or Cmd on a Mac). You can add more files afterwards, reorder them or remove one; they are merged in the order listed.
  2. Leave “Files have a header row” ticked so columns are matched by name.
  3. Tick “Add a column with the source file name” if you need to trace each row back to its file, and “Excel-compatible” if the result will be opened in Excel.
  4. Click Merge CSV files and download merged.csv.

Example

Two exports with different column orders, merged with the source column.

january.csv and february.csv
id,name,email
1,Ana,[email protected]

email,id,name,phone
[email protected],2,Ben,555-0102
merged.csv
id,name,email,phone,source_file
1,Ana,[email protected],,january.csv
2,Ben,[email protected],555-0102,february.csv

When you need it

Monthly, store or regional exports
Many tools export one CSV per month, store or campaign: bank statements, order exports, ad reports, survey responses. One merged table is easier to filter, pivot or import.
Exports whose columns have changed
When a vendor adds or reorders a column, pasting files under each other silently shifts values into the wrong columns. Matching by header name avoids that.
Preparing a single import file
Merge the files, check the result with the CSV validator, then split it again if it is over the platform's import limit.

How columns are matched

The first row of each file is read as its header. The merged file contains every column found in any file, in the order they first appear. Names are compared after removing surrounding spaces and the invisible byte order mark some programs add, so “email” and “ email” are the same column. The comparison is case-sensitive: “Email” and “email” stay separate columns. When a file has no such column, its cells are left empty.

Why copy and paste in Excel goes wrong

Pasting one file under another only works while every file has the same columns in the same order. Excel also changes data as it opens a CSV: 00123 becomes 123, and numbers longer than 15 digits, such as card or order IDs, lose their last digits because Excel keeps 15 significant digits.

This tool treats every value as text and copies it unchanged, so the merged file contains exactly what the source files contained. Tick “Excel-compatible” to add the UTF-8 byte order mark Excel needs to display accented letters correctly; leave it off if the file goes into a database or script.

Browser and file limits (not a trial)

These are technical limits of running in your browser—device memory, encoding and what this tool does not do. They are not a free trial, account quota or paid plan. There is no subscription.

  • Each file's delimiter is detected automatically. The merged file uses the delimiter of the first file.
  • Without a header row, columns cannot be matched by name: rows are appended as they are, so the files must share the same column order. The source column needs headers too.
  • Rows with more cells than their file's header lose the extra cells. The result tells you how many rows were affected.
  • The merged file is assembled in your browser's memory, so the total size you can merge depends on your device.

Frequently asked questions

How do I combine multiple CSV files into one?

Add the files to the picker and click Merge CSV files. The rows of each file are appended in the order listed, under a single header row, and you download one merged.csv.

How do I combine CSV files with pandas in Python?

Read each file and stack them with pd.concat([pd.read_csv(f, dtype=str) for f in files], ignore_index=True), then save with .to_csv("merged.csv", index=False). concat matches columns by name, like this tool; pd.merge is for joining two tables on a key column, not for stacking rows. dtype=str keeps values such as 00123 unchanged.

What if my CSV files have different columns?

The merged file contains every column that appears in any file. Values are placed by header name, and a file that lacks a column gets empty cells there.

How do I merge CSV files in Excel or with the command prompt?

In Excel, Data > Get Data > From File > From Folder loads a folder of CSV files into Power Query, which can combine them in a few steps; the result is still limited to 1,048,576 rows. In Windows Command Prompt, copy *.csv merged.csv joins files byte by byte, which repeats every header and ignores column order.

Will merging change ZIP codes or long ID numbers?

No. Every value is copied as text, so 00123 stays 00123 and a 16-digit ID keeps every digit. Those changes usually happen later, when a CSV is opened by double-clicking it in Excel. Use Data > From Text/CSV and set the column type to Text to avoid them.

Can I see which file each row came from?

Yes. Tick “Add a column with the source file name” and the merged file gets a final source_file column with the original file name on every row.

How do I merge multiple CSV files into one?

Add every file to the picker (order is the merge order), leave the header option ticked so columns match by name, then click Merge CSV files. You download one merged.csv. That covers “combine”, “concatenate” and “append” for stacking rows under one header.

How do I append CSV files without breaking columns?

Appending with copy in Command Prompt or by pasting under another sheet fails when column order differs. Here columns are matched by header name, so an email column stays under email even if it was in a different position in each file.

Related tools

Go further

Your files never leave your device

PrivateCSV runs this tool in your browser. No upload, no account, no trial and nothing to install.