To merge CSV files into one file in Windows 11, put them all in one folder, open Command Prompt in that folder, and run copy /b *.csv combined.txt. Then rename combined.txt to combined.csv. Windows joins every CSV into a single file. If each file has its own header row, use the PowerShell or Excel method below so the headers aren’t repeated. If a program needs a different separator, here is how to convert a CSV file to pipe delimited.
These steps work in Windows 11 and Windows 10. The Excel method uses Power Query, which is built into Excel for Microsoft 365, Excel 2024, 2021, 2019 and 2016 on Windows.
Which Method Should You Use?
| Method | Best for | Header rows | Files with different columns |
|---|---|---|---|
| Command Prompt copy | A fast one-time merge of identical files | Repeated once per file | Not matched; data can shift |
| PowerShell | One clean file with a single header | Written once | Matched by column name, with limits |
| Excel Power Query | No commands, cleanup, and repeat merges | Used once | Matched by column name |
If you only need the data in a spreadsheet, start with Excel. If you need a new .csv file to upload somewhere, PowerShell gives the cleanest result.
Make Copies and Check the Files First
A few minutes of checking prevents most merge problems.
- Make copies. None of these methods changes the original files, but keep a backup folder anyway, especially before you delete rows from the result.
- Use a folder that holds only the files to merge. Every method picks up every CSV in the folder, including an old combined file from an earlier try.
- Compare the header rows. Open two or three files in Notepad and look at the first line. “Email”, “email” and “E-mail” count as different columns. You can open a CSV file in Notepad to see the raw text without Excel changing it.
- Check the separator. Most files use commas, but some exports use semicolons or tabs. Files with different separators shouldn’t be merged with the copy command.
- Note how many rows each file has. You’ll use this later to confirm nothing went missing.
Method 1: The Copy Command (Fastest)
Microsoft’s documentation for the copy command explains that when you list several source files and one destination, copy combines them into that single file.
- Put all the CSV files you want to merge in one folder, with nothing else in it.
- Open that folder in File Explorer, click the address bar, type cmd, and press Enter. Command Prompt opens in that folder.
- Type
copy /b *.csv combined.txtand press Enter. Command Prompt lists each file name as it copies it. - Rename combined.txt to combined.csv.
You get one combined.csv with every row from every file.
The /b switch copies each file exactly as it is. Without it, Microsoft notes that copy treats combined files as plain text and can add an end-of-file character (Ctrl+Z) to the end of the output, which some programs read as a stray symbol. Saving to a .txt name first keeps the new file from being picked up by *.csv while the command runs.
Heads-up: this method keeps every file’s header row, so you’ll see the column names repeated wherever one file ends and the next begins. Delete those extra rows in Excel, or use Method 2.

If a source file doesn’t end with a line break, its last row joins the next file’s first row in combined.csv. To prevent that, open each file in Notepad and press Ctrl + End. If the cursor sits at the end of the last row instead of on an empty line, press Enter, save, and run the command again. To review the result, you can make CSV files open in Excel by default.
Merge only some files, in a set order
The wildcard *.csv takes every CSV in the folder, usually in alphabetical order by file name. To pick the files and their order yourself, list them with plus signs:
copy /b january.csv + february.csv + march.csv combined.txt
Put the file whose header you want to keep first.
Remove the repeated header rows
- Open combined.csv in Excel.
- Click row 1, then select Data › Filter.
- Open the filter arrow on the first column and check only the value that matches that column’s header name.
- Select the visible rows below row 1, right-click, and choose Delete Row.
- Select Data › Filter again to turn the filter off, then save the file as CSV.
Only the header in row 1 remains.
Method 2: PowerShell (Removes Duplicate Headers)
If every file has the same column headers, PowerShell can read them as data and write one clean file. It uses the Import-Csv and Export-Csv commands.
- Open the folder, click the address bar, type powershell, and press Enter.
- Run this command:
Get-ChildItem *.csv | ForEach-Object { Import-Csv $_.FullName } | Export-Csv ..\combined.csv -NoTypeInformation -Encoding UTF8 - Find combined.csv in the folder one level up.
You get one clean file with a single header row, ready to open in Excel or import elsewhere.
What each part does:
..\combined.csvsaves the result in the parent folder, so a second run doesn’t read the combined file back in.-NoTypeInformationstops Windows PowerShell 5.1, the version that opens from the address bar, from adding a “#TYPE” line at the top of the file.-Encoding UTF8keeps accented letters and symbols intact. Export-Csv defaults to ASCII encoding in Windows PowerShell 5.1, and ASCII can’t store characters like é or ñ.
What happens when columns don’t match
Microsoft’s Export-Csv documentation says the output uses the columns of the first file it receives. Rows from later files that lack one of those columns get an empty value there. Columns that appear only in later files are left out of the result entirely. If your files have different columns, use Power Query instead, or rename the headers so they match before you merge.
Files that use semicolons
Add -Delimiter ';' to both Import-Csv and Export-Csv. Keep the single quotation marks around the semicolon.
Method 3: Excel Power Query (No Commands)
- In Excel, go to Data › Get Data › From File › From Folder.
- Choose the folder with your CSV files and select Open.
- Select Combine › Combine & Load.
- Pick the first file as the example, then select OK.
Microsoft’s Import data from a folder with multiple files article walks through it. Power Query uses the headers once and refreshes if you add more files later.
In the Combine Files dialog, you can set the File Origin, Delimiter and Data Type Detection, and choose Skip files with errors so one bad file doesn’t stop the import.

Excel creates a single table from all the files, which you can save as a new CSV or workbook.
Clean the data before it loads
Choose Combine › Combine & Transform Data instead of Combine & Load to open the Power Query Editor first. There you can:
- Set ID, ZIP code and phone number columns to Text so Excel keeps their leading zeros.
- Use the filter on the Source.Name column, which shows which file each row came from, to leave out a file.
- Remove duplicate rows before loading.
Select Home › Close & Load when you’re done.
Save the result as a CSV file
Select File › Save As, choose CSV UTF-8 (Comma delimited) as the file type, and save. Excel saves only the active sheet in a CSV file, so stay on the sheet that holds the combined table.
Add more files later
Drop the new CSV files into the same folder, then select Data › Refresh All. The table updates with the new rows.
Confirm the Merge Worked
Add up the data rows in your original files (not counting header rows) and compare that number with the data rows in the combined file. They should match, unless you removed duplicates on purpose.
You can also check in PowerShell. In the folder with your original files, run (Get-ChildItem *.csv | ForEach-Object { Import-Csv $_.FullName }).Count for the original total, then (Import-Csv ..\combined.csv).Count for the merged file.
When the Header Row Repeats
- The header row appears many times: that’s normal for the copy command. Filter and delete the extra rows, or use PowerShell or Power Query.
- Two rows are joined on one line: a source file has no line break at the end. Add one in Notepad and run the merge again.
- The data appears twice: an earlier combined file was still in the folder. Delete it and run the merge again.
- Everything is in one column: the files use a semicolon or tab separator. Set the Delimiter in Power Query, or add
-Delimiter ';'in PowerShell. - Accented letters look garbled: the files use different text encodings. Open each file in Notepad, choose File › Save as, set Encoding to UTF-8, and merge again. In Power Query, set File Origin to match the files.
- Leading zeros are gone: Excel converted the column to numbers. Merge again with Power Query and set that column to Text before loading.
- Columns are shifted or half empty: the header names don’t match exactly. Fix the spelling and spacing in the first line of each file, then merge again.
- Rows are missing in Excel: a worksheet holds 1,048,576 rows, per Microsoft’s Excel specifications and limits. For more rows, use the copy command or PowerShell, which write a file without that limit.
CSV Merge Questions
Will merging change my original CSV files?
No. All three methods read the files and write a new combined file, leaving the originals as they were.
What if my files use semicolons instead of commas?
Use the Excel method and set the Delimiter in the Combine Files dialog, or add -Delimiter ';' to the PowerShell command. Avoid the copy command if some files use commas and others use semicolons.
Can I merge CSV files into separate sheets of one workbook?
Not as a CSV. A CSV file holds one sheet of plain text, so a file with several tabs has to be saved as an Excel workbook (.xlsx). Power Query stacks all the files into one table instead.
How do I combine files that share an ID column instead of stacking them?
That’s a join, not a merge. In Power Query, load each file as its own query and use Home › Merge Queries, or use XLOOKUP in Excel to pull values from one sheet into the other.
How do I remove duplicate rows after merging?
Overlapping exports often repeat records. You can remove duplicates in Excel with Data › Remove Duplicates after you open the combined file.
If the merged file is a contact list, here’s how to import an Excel list into Outlook contacts.
Prefer working in a browser? You can upload the CSV file to Google Drive and open the combined file in Google Sheets.
New to the command line? Here’s how to open Command Prompt in Windows 11.
Combining contact lists? Once they’re in one file, you can import the contacts to Gmail from the CSV. Google asks you to keep each import to 3,000 contacts or fewer.

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are checked step by step against the device or app maker’s own documentation and tested on his own devices whenever he has the hardware or software, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.