The quickest way to merge multiple CSV files on Windows is with one command. Put all the CSV files in one folder, open that folder in File Explorer, type cmd in the address bar, press Enter, and run copy *.csv combined.csv. Windows joins every CSV into a new file called combined.csv. The catch is that each file’s header row gets copied too. To merge files and keep just one header, use the PowerShell command below or Excel’s Get Data > From Folder feature.
Before you start
- Put all the CSV files you want to merge in one folder, with nothing else in it.
- Make sure the files have the same columns in the same order, or the merged file will be mixed up.
- Keep a backup of the originals.
Method 1: Command Prompt (fastest)
- Open the folder with your CSV files in File Explorer.
- Click the address bar, type cmd, and press Enter. Command Prompt opens in that folder.
- Type
copy *.csv combined.txtand press Enter. - Rename combined.txt to combined.csv.
Saving to a .txt file first stops the new file from copying into itself. The merged file includes each file’s header row, so open it in Excel and delete the extra header rows, or use Method 2.
Method 2: PowerShell (keeps one header)
- Open the folder in File Explorer, click the address bar, type powershell, and press Enter.
- Run this command:
Get-ChildItem *.csv | ForEach-Object { Import-Csv $_ } | Export-Csv combined.csv -NoTypeInformation - Open combined.csv. It has one header row and all the data from every file.
Run it once. If you run it again, delete the old combined.csv first so it isn’t included.
Method 3: Excel Power Query (no commands)
- Open a new workbook in Excel.
- Go to Data > Get Data > From File > From Folder.
- Browse to the folder with your CSV files and click Open.
- Click Combine > Combine & Load.
- Pick the first file as the example, check the preview, and click OK.
- Excel stacks all the files into one table. Save it with File > Save As > CSV UTF-8 (Comma delimited) if you need a CSV.

Power Query adds a Source.Name column showing which file each row came from. If you add new files to the folder later, click Data > Refresh All to update the table.
Method 4: Mac or Linux Terminal
- Open Terminal and go to the folder: type
cd(with a space) and drag the folder into the window, then press Return. - To merge with every header:
cat *.csv > combined.csv - To keep only the first header:
awk 'FNR==1 && NR!=1 {next} {print}' *.csv > combined.csv
Method 5: Google Sheets (small files)
Import the first CSV into a new sheet with File > Import > Upload. For each additional file, choose Import again and pick Append to current sheet. Then delete any repeated header rows and download it with File > Download > Comma-separated values (.csv).
Troubleshooting
- Last row of one file is joined to the first row of the next: A file didn’t end with a line break. Use the PowerShell or Excel method, which handle this for you.
- Strange characters: The files use different encodings. Open them in Excel or save them as UTF-8 before merging.
- Columns don’t line up: The files have different column orders or names. Power Query can match columns by name.
- Too many rows for Excel: Excel sheets hold about 1 million rows. Use the Command Prompt or PowerShell method and a database or text editor for bigger files.
Frequently asked questions
Can I merge CSV files without Excel?
Yes. Command Prompt, PowerShell, and Terminal are built into Windows and Mac and don’t need Excel.
How do I merge CSV files with different columns?
Use Excel Power Query. It combines columns with the same name and adds new columns for ones that only exist in some files.
Is there a limit to how many files I can merge?
Not really with the command methods. They work with hundreds of files, as long as you have enough disk space.

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.
He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.