How to Merge Multiple CSV Files Into One

Updated July 2026 · By the CSVUndo team · 6 min read

The quick answer: you have four common options, and they are not equal. A browser merger stacks the files and aligns rows by column name, takes the header once, and never touches Excel — the cleanest route for most people. Excel’s Power Query “From Folder” combines every CSV in a folder and is great for a repeatable pipeline. The Windows copy *.csv command and the Unix cat are fastest of all but concatenate blindly — they keep every file’s header row and can’t realign mismatched columns. Pick by how clean you need the result and whether you’ll repeat it.

The four methods compared

The real differences are how they handle headers and mismatched columns:

MethodHeader handlingAligns different columns?Best for
Browser mergerTaken onceYes — by column nameA quick, private, clean one-off
Power Query From FolderTaken onceYesA repeatable, refreshable pipeline
copy *.csv (Windows)Kept from every fileNoSpeed, when files are identical and you’ll clean up
cat *.csv (Mac/Linux)Kept from every fileNoSame, on Unix

In your browser: aligns by column name

This is the option that won’t damage anything and needs no setup. Because it reads each file’s header and lines up the data by name, files whose columns are in a different order — or that gained a column one month — still combine correctly instead of shifting into the wrong fields.

  1. Open the CSV merger and drop in all your files (or pick them together).
  2. Leave First row is a header ticked so the header is taken once and rows align by name. Tick Add a source-file column if you want to keep track of which file each row came from.
  3. Click Merge & Download. Everything runs on your device — the files are never uploaded.

Merge them now, in the browser

Drop in a folder’s worth of CSVs and download one combined file — aligned by column name, header taken once, optional source column, nothing uploaded.

Open the CSV merger →

Excel Power Query “From Folder”

If you need to repeat the merge every month, Power Query is the durable choice: point it at a folder and it combines every CSV inside, and you can hit Refresh when new files land. Go to Data → Get Data → From File → From Folder, choose the folder, then Combine & Transform. One caution that’s easy to miss: Power Query will still apply Excel’s type-guessing, so set identifier columns (barcodes, ZIP codes, IDs) to Text in the editor, or you’ll re-introduce the leading-zero and scientific-notation damage this whole site is about — see opening a CSV in Excel without breaking it. Microsoft documents the feature in its Power Query import guide.

The copy / cat command (fast but blunt)

Fastest of all, with one big caveat: it keeps every file’s header. In a Windows Command Prompt, cd into the folder and run copy *.csv combined.csv; on Mac or Linux, cat *.csv > combined.csv. Both simply glue the files end to end. That’s perfect when the files are truly identical and you don’t mind a tidy-up — but the header row of every file lands in the output, so you get a stray header line between each file’s data, and if any file has its columns in a different order the rows silently misalign. Use it for speed, then delete the extra header rows (or run the result through a cleaner).

After merging: de-duplicate

Merging stacks rows; it doesn’t remove duplicates. If the same record appears in two of your files — a customer who ordered in both January and February, say — it appears twice in the combined file, which is often correct but sometimes not. When you need one row per record, run the merged file through the CSV cleaner to drop duplicate rows (and blank rows and stray spaces) in a single pass. And if the pieces came from different systems with different encodings, the encoding checker tells you whether the combined file is consistent. Browse all guides for the rest.

Frequently asked questions

How do I combine multiple CSV files into one?

The quickest private way is a browser merger: drop all the files in and download one combined CSV, with the header taken once and rows aligned by column name. In Excel, Data → Get Data → From File → From Folder (Power Query) combines every CSV in a folder. On the command line, copy *.csv combined.csv (Windows) or cat *.csv (Mac/Linux) concatenates them, but keeps every file’s header row.

How do I merge CSV files with the copy command?

In a Windows Command Prompt, cd into the folder and run copy *.csv combined.csv. It’s fast, but it concatenates the files, so the header row of every file ends up in the output — a stray header line between each file’s data that you must delete afterwards. A tool that takes the header once avoids that cleanup.

What if my CSV files have different columns?

Align them by column name rather than position. A good merger reads each file’s header and places every value under the matching column, adding any new columns and leaving blanks where a file lacks one. A blind copy/cat concatenation does not do this and will misalign files whose columns are in a different order.

How do I remove duplicate rows after merging?

Merging only stacks rows, so a record in two files appears twice. Run the merged file through the CSV cleaner, which removes duplicate rows in one pass, keeping the first occurrence of each.

Sources: combining files in Excel is documented in Microsoft’s Power Query import guide; the recurring need is well attested on Microsoft Q&A.