CSV Merge

Append rows from several CSV files into a single table, matched by column name or by position.

Runs on your deviceDataWorkingNo account needed

What this tool does

CSV Merge reads every file you hand it and writes one CSV carrying the rows of all of them, in the order the files were listed. Parsing respects quoting: double quotes around a field let it hold the delimiter, and even a line break, as ordinary text, while two quote marks in a row inside such a field mean one literal quote. Left on automatic, the separator is worked out for each file on its own, so a comma export and a semicolon export can go into the same job; name a delimiter by hand instead and it applies to all of them. What the merged file is written with is a separate choice.

With "Every file starts with a header row" ticked, columns are lined up by their names rather than their positions, so a file that puts name before id still lands in the right columns. Matching ignores case and surrounding spaces, and the heading printed at the top of the result keeps the spelling used by the first file that had it. One radio then decides the shape of the output: every column found, the default, keeps the union and leaves an empty cell wherever a file had nothing to give; only the first file's columns discards anything the later files added; only columns present in every file keeps the overlap, and refuses the job with an explanation when the files turn out to share no names at all.

Untick the header box and the files stack by position instead. The widest row anywhere in the batch fixes the column count, shorter rows gain empty cells to reach it, cell one meets cell one, and no header line is written — unless you also switch on the source-file column, in which case the result gains a header row reading source_file, column_1, column_2 and so on. The remaining switches work on rows rather than columns. The duplicate filter compares a whole row after alignment and keeps the first copy, so it catches a record that appears in two exports. Dropping empty rows is on by default and removes rows whose every cell is blank.

The work happens in this browser tab — the files are read, merged and offered back as a download without leaving your machine — and the practical limits follow from that and from what the code actually does. Every file is held in memory at once, so a handful of large exports will make the tab work for it. Text is decoded as UTF-8, so a file saved in an older Windows codepage arrives with its accented characters mangled, and the merged file is written as UTF-8 with no byte-order mark. Most importantly, this appends rows; it does not join on a key. Two files sharing an id column produce one table with both sets of rows stacked under each other, not one row per id with the columns combined.

How to use it

  1. Choose the files. Pick the .csv, .tsv or .txt files to combine — they are merged in the order they are listed. A single file is accepted too, and comes back as one .csv carrying a -merged suffix.
  2. Say whether the files carry a header row. Ticked, the first line of each file is treated as column names and used for matching. Unticked, the files line up by position and every line counts as data.
  3. Decide which columns survive. Every column found keeps the union and pads the gaps; only the first file's columns trims to that file's header; only columns present in every file keeps the overlap.
  4. Add a source column or filter rows. A source_file column records which file each row came from. The duplicate and empty-row switches drop rows before they are written out.
  5. Set the delimiters and run. Leave the input delimiter on automatic or name it per job, and pick comma, semicolon, tab or pipe for the output. The summary reports files in, rows and columns out, and any rows that were dropped.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Rejoining monthly exports

Twelve reports with the same headers become one table, so a year can be counted, sorted or charted in a single pass instead of twelve.

Two exports whose columns are in a different order

Name matching puts each value under its own heading, so neither file has to be rearranged by hand before they can be stacked.

Pooling responses from several forms

Different forms collect overlapping fields. The union setting keeps every question asked and leaves a blank where a form did not ask it.

Preparing one file for an importer

Import screens usually accept a single upload. Merging first turns a folder of partial exports into the one file the screen will take.

Tracing a row back to where it came from

With the source column on, every row names its own file, which is what makes a merged table auditable once a figure looks wrong.

Questions

Are my files uploaded anywhere?
No. CSV Merge opens and combines them by script inside this browser tab; none of their contents are sent, recorded or retained, and a merge completes just as well with the machine offline.
Can it join two files on a shared ID?
No, and this is the difference worth being clear about. It appends rows: a customers file and an orders file produce one long table with both sets of rows underneath each other, not one row per customer with the order fields attached. A key-based join is a spreadsheet lookup or a database query, not this tool.
What happens when the files have different columns?
That depends on the columns setting. Every column found keeps all of them and writes an empty cell wherever a file had no such column. Only the first file's columns silently drops the extras. Only columns present in every file keeps the overlap, and refuses the job when there is no overlap to keep.
One of my files has two columns with the same header — what happens?
Only the first of them is ever read. Under the default union setting the name appears once in the output and the second column's values are dropped. Under only the first file's columns the repeated heading survives, and both copies of it show the values of the first column. Either way the duplicate's own values are lost, so rename that header before merging if both sets matter.
What counts as a duplicate row?
An exact match across every cell, compared after the columns have been aligned, so it works between files as well as within one. The comparison is literal: Ada and ada are different rows, and so are a value with a trailing space and the same value without. The header row is never a candidate, and the source-file column is left out of the comparison, so a record present in two exports still collapses to one row.
Can the delimiter be detected wrongly?
Yes. The guess is made per file by tallying how often a comma, semicolon, tab or pipe turns up in its first five lines and taking the winner — a tally that counts the ones sitting inside quoted text too. An address column full of semicolons can therefore outvote the commas that really separate the fields, so name the input delimiter by hand when the columns come out shifted.
Does it change the values in my cells?
Numbers, dates and leading zeros are carried across as text, with no reformatting. What changes is the packaging: quoting is recalculated for the output delimiter, rows are joined with CRLF, and no newline follows the last row. The exception is stray quote marks. A quote inside a field that is not itself quoted is read as quoting rather than as text, so a matched pair is swallowed and a single one runs on until the next quote or the end of the file. Fields quoted as a whole, which is what exporters produce, survive untouched.
How many files, and how large?
No count or size limit is imposed. Every file is read into memory before the merge starts, so your device decides: a stack of ordinary exports is unremarkable, and several very large ones will make the tab pause. To go the other way, CSV Split cuts one oversized file back into pieces.

Related tools

  • JSON to CSV — Flatten a JSON array into a CSV table.
  • CSV to JSON — Turn a CSV file into structured JSON.
  • CSV Viewer — Open and browse a large CSV without a spreadsheet app.
  • CSV to Excel — Convert CSV files into an XLSX workbook.
  • Excel to CSV — Export spreadsheet sheets to CSV.
  • CSV Split — Split a large CSV into smaller chunks.