Merge CSV files into one
Combine multiple CSVs into a single file — even when columns differ, the merger unions the headers and aligns every row. All in your browser.
Runs 100% in your browser — this page makes no network request with your data.
- 1
Select multiple CSV files (monthly exports, per-region files, split datasets).
- 2
The tool unions all headers and aligns rows; download the merged CSV.
- 3
Analyze the merged dataset in the workspace with one click.
Worked example: combining twelve monthly sales exports
A finance analyst keeps twelve monthly sales exports from the company's ERP, one CSV per month. The columns drifted slightly over the year, a "discount_code" field appeared mid-year and one month labels the total as "net_total" instead of "total", so a naive copy-paste would misalign everything.
They select all twelve files at once in the merger. The tool takes the union of every header it finds and aligns each row to the right column, leaving an empty cell wherever an older file simply did not have that field. The result is one clean CSV covering the full year, downloaded straight from the browser with nothing uploaded.
From there the analyst clicks "Turn this into a report" to send the combined year into the workspace, where they can chart revenue by month, compare quarters, and export a shareable summary, analysis that was impossible while the data sat in twelve separate files.
Merging CSV files means combining several files into one. Almost every merge is one of two operations that get confused for each other: appending, which stacks files on top of one another to make more rows, and joining, which matches files side by side on a shared key to make more columns. Naming which one you need is the whole battle.
Combining monthly exports into a full year is an append. Attaching each customer's plan tier from a second file is a join. The tool above appends and unions the columns, which covers the common case; joins are a matching problem best done where you can see the keys line up.
Append versus join: the distinction that trips everyone up
If your files hold the same kind of record for different periods or sources, you append them. If your files hold different facts about the same records, you join them. Getting this wrong is the number-one cause of a merge that looks done but is quietly nonsense, duplicated rows on one side, or a Cartesian blow-up on the other.
| Append (stack) | Join (match) | |
|---|---|---|
| What it does | Puts files end to end | Matches rows on a shared key |
| Result grows | More rows | More columns |
| Use when | Same columns, different records (Jan + Feb sales) | Same records, different fields (orders + customer details) |
| Needs a key column? | No | Yes (an ID or email both files share) |
| Typical mistake | Duplicate records across files | Many-to-many keys multiplying rows |
Handling column mismatches when you append
Real exports drift. A field appears mid-year, a column gets renamed, someone reorders the export, and now a blind top-to-bottom stack misaligns everything. The safe way to append is to align by header name, not by position, and take the union of all columns so nothing is dropped.
That is what the merger above does: it reads every header it finds, lines each row up under the right column name regardless of order, and leaves an empty cell wherever an older file simply lacked a field. The failures to watch for are subtler than missing columns:
- Renamed columns: net_total in one file and total in another become two separate columns unless you rename one first. The values are right but split across two headers.
- Whitespace in headers: a trailing space makes Region and 'Region ' distinct columns. Trim header names before merging.
- Case differences: Email and email may or may not be treated as the same column depending on the tool, worth checking on the merged result.
- Type drift: a column that is text in one file and a number in another still stacks fine, but the mixed column may need cleaning before analysis.
Ways to combine CSV files, compared
The method matters most for how it handles the header row, because that is where the classic corruption happens. Concatenating files at the shell is fast but keeps every file's header, injecting stray header rows into the middle of your data.
| Method | Good for | Header behavior |
|---|---|---|
| Browser merger (this page) | Files whose columns have drifted apart | Unions headers, keeps one header row, aligns by name |
| Shell: copy *.csv or cat *.csv | Quick stacks of identical files | Repeats every file's header inside the output; must strip them after |
| Excel Power Query | Repeatable merges you refresh | Handles headers, but has a learning curve |
| Python (pandas concat) | Scripted, reproducible pipelines | You control headers explicitly; you write the code |
Deduplicating after a merge
Appending keeps every row from every file, so if the same record appears in two exports it appears twice in the output. That is deliberate, because whether two rows are duplicates depends on which column is the unique key, and only you know that.
There are two kinds of duplicate to handle. Exact duplicates are identical across all columns and are safe to collapse. Key duplicates share an ID or email but differ elsewhere, maybe an updated address, and collapsing those means choosing which version wins. Deciding that rule is analysis, not merging, so send the combined file to the workspace and ask for a de-duplicated view on the key you name; you will see how many rows collapsed and can confirm the right record was kept.
Encoding pitfalls when merging exports from different systems
The moment your files come from different tools, encoding stops being guaranteed. One system exports UTF-8, another writes Windows-1252 or Latin-1, and stacking them produces a file where some rows have clean accented characters and others show garbled ones.
The fix is to normalize before or during the merge, not after. Confirm each source's encoding, convert everything to UTF-8, and check the merged file for mojibake in name and address columns, which is where non-ASCII characters live. Two more cross-system gremlins are worth a look: mixed delimiters, where one export uses semicolons and another commas, and inconsistent date formats, where one file writes 03/04 as March 4 and another as April 3. Neither breaks the merge, but both break the analysis that follows unless you catch them. Reading the combined file in the CSV viewer first is the cheapest way to spot all three before they cost you a re-run.
Frequently Asked Questions
Everything you need to know about using AnalyzeData.
Yes — the merged file contains the union of all columns; rows missing a column get an empty cell there. That is usually what you want when combining exports from different periods or sources.
Select all the monthly files at once, download the merged CSV — or click "Turn this into a report" to analyze the combined months immediately.
No fixed limit; practical browser memory supports dozens of typical export files. Everything stays local.
No. The merger takes the union of every column across all your files and aligns each row to the correct header, regardless of the order columns appear in. When one file is missing a column another file has, those cells are simply left empty. That is what makes it safe to combine exports from different periods or systems whose formats have drifted.
No; the merge keeps every row from every file, so if the same record appears in two exports it appears twice in the output. That is deliberate, since deduplication depends on which column counts as the unique key. To find and collapse duplicates, send the merged file to the workspace and ask for a de-duplicated view.
Merging usually means appending, stacking files to add more rows of the same kind of record, like combining January and February sales. Joining means matching files on a shared key to add more columns, like attaching each order's customer details from a second file. Appending needs no key column; joining does. Deciding which you need is the first step, because the tools and pitfalls differ completely.
Select all the files in a merger and it stacks them into a single file with one header row. If your files are truly identical in structure, even a shell command like cat works, but it repeats each file's header inside the output, so you must strip those rows afterward. A merger that keeps a single header avoids that cleanup entirely.
You concatenated the raw files, so every file after the first contributed its own header line into the body. This happens with copy *.csv or cat *.csv. Either delete those repeated header rows, or use a merger that recognizes the header and writes it only once at the top of the combined file.
Not directly in a CSV merger, since the formats differ. Convert the Excel sheet to CSV first, using an [Excel viewer](/tools/excel-viewer) or a save-as, then merge the CSVs. Alternatively, upload both files to the workspace, which reads CSV and XLSX alike and can combine them there without a manual conversion step.
When a table isn't enough
The workspace runs verified AI analysis on the same file and turns the results into a report you can send.
Analyze this data instead