How to merge files
- Choose the files (you can select several at once, or drop them).
- Put them in the order you want the rows in, with the arrows.
- Check the preview, then download one Excel or CSV file.
Values are copied exactly: leading zeros, long ID numbers and dates stay as they were in each file. Each file's header row is used once, not repeated in the middle of the data.
How to combine files in Excel
In Excel for Microsoft 365 and Excel 2016 or later, Power Query can combine all files in a
folder: Data → Get Data → From File → From Folder, choose the folder, then Combine → Combine
& Load. It works best when every file has the same columns; it uses the first file as
the example. To stack sheets of one workbook, =VSTACK(Sheet1!A2:D100, Sheet2!A2:D100) works in Microsoft 365 when the columns are in the same order.
On Windows you can also join CSV files that have no header row from the Command Prompt with copy *.csv merged.csv; with headers, the header of each file ends up in the
middle of the data.
In Google Sheets
Import each file into its own sheet (File → Import → Insert new sheet), then stack them with
an array: ={Sheet1!A2:D; Sheet2!A2:D} or =VSTACK(Sheet1!A2:D, Sheet2!A2:D). The columns have to be in the same order in
every sheet.
Questions
- Do the files need the same columns in the same order?
- No. Columns are matched by their header, so "Email" in one file lines up with "Email" in another wherever it is. Columns that only some files have are added, and left empty for rows from the other files. If your files have no header row, match columns by position instead.
- Can I merge CSV and Excel files together?
- Yes, any mix of CSV, TSV, XLSX, XLS and ODS files. Each file can have its own delimiter and encoding; they are detected for each file.
- How do I combine all the sheets of one workbook?
- Choose the workbook: all its sheets are included, one after the other. To use only some, pick a sheet in that file's options, or add the file again for another sheet.
- Can I tell which file each row came from?
- Tick "Add a Source column" to get a first column with the file name (and sheet name for workbooks with several sheets).
- Can I put each file on its own sheet instead?
- Yes: choose "Each file on its own sheet" and download Excel. You get one workbook with a sheet per file (or per sheet of each workbook).
- How many files or rows can I merge?
- As many as your computer's memory allows; nothing is uploaded, so there is no upload limit. An Excel sheet holds at most 1,048,576 rows, so a bigger result continues on more sheets; CSV has no limit.
Related tools
- Compare Two Excel or CSV Files Compare two Excel or CSV files online and see added, removed and changed rows, matched by order or by an ID column. Free; files stay on your computer.
- Convert CSV, Excel, JSON and XML Files Convert between CSV, Excel, JSON and XML online without losing leading zeros, long IDs or dates. Free; your files are converted in your browser, never uploaded.