PRACTICAL WORKFLOW GUIDE

Compare Two Inventory CSV Files by SKU (Additions, Removals, Changes)

Find actual stock changes between two exports without mistaking reordered rows for changes. Includes two reproducible sample CSV files.

An inventory CSV from a warehouse, Shopify export, or supplier often arrives in a different sort order every day. Comparing line 3 of yesterday's file against line 3 of today's file does not establish whether anything changed. The correct approach for this example is to identify a product using its SKU, then compare the records belonging to the same SKU.

Below are two complete sample CSV files used to test the free comparison tool. They contain three SKUs in each snapshot: one stock change, one unchanged product, one new product and one SKU missing from the newer export. No real merchant, customer or supplier data is included.

Example input and expected output

Source data

PREVIOUS CSV
SKU,Title,Stock
MUG-001,Blue Mug,10
CUP-002,Red Cup,5
BAG-009,Old Bag,2

CURRENT CSV
Stock,SKU,Title
7,MUG-001,Blue Mug
5,CUP-002,Red Cup
12,PLATE-003,Stone Plate

Expected result

Summary: ADDED 1 · REMOVED 1 · CHANGED 1 · UNCHANGED 1

Change report excerpts:
action,key,field,before,after
CHANGED,MUG-001,Stock,10,7
ADDED,PLATE-003,Stock,,12
REMOVED,BAG-009,Stock,2,

Download the verified sample CSV files

These fictional samples are used by the steps below and contain no customer data.

Step-by-step workflow

  1. Download both samples above. Open each in a text editor to see the header order difference: previous starts with SKU, while current starts with Stock.
  2. Open the CSV version comparator. Choose the previous export for the first input, and the current export for the second. The files are read in the browser; the site does not offer a file-upload API.
  3. Select SKU as the unique comparison key. Keep case-sensitive matching enabled if MUG-001 and mug-001 should be considered different identifiers.
  4. Run Compare CSVs. You should see 3 previous records, 3 current records, 1 added SKU, 1 removed SKU, 1 changed SKU and 1 unchanged SKU.
  5. Download the audit CSV. MUG-001 changed Stock from 10 to 7; CUP-002 is unchanged; PLATE-003 is new and BAG-009 is missing from the newer file.
  6. Before making changes in a live inventory system, verify that the missing BAG-009 is not merely absent because your second export was filtered, incomplete or generated from a different location.

Why line-by-line comparison gives false positives

If a supplier sorts yesterday's file by SKU and today's by Stock, the third physical line can describe an entirely different product. Diffing raw lines produces noisy changes and misses the business meaning. A stable key such as SKU, product ID or order ID identifies the same entity even when the export order changes.

Column order may also change between exports. The checker compares fields by the exact header name, not their position. In the samples, yesterday's SKU,Title,Stock and today's Stock,SKU,Title are treated as the same three columns.

What ADDED, REMOVED, CHANGED and UNCHANGED mean

ADDED means a comparison key appears only in the current file. REMOVED means it appears only in the previous file. CHANGED means at least one field differs for a key found in both. UNCHANGED means values are equal for the same key. A CHANGED key can generate multiple field-level lines in the downloaded audit.

The downloadable report shows the original CSV line numbers for before and after, with an action, comparison key, field name and both values. Newly added and removed products generate one report line per source field, so audit line counts can be higher than the number of products.

Unique keys, leading zeroes and whitespace

The comparator rejects blank and repeated comparison keys. If two variants share the same SKU, choose a more precise identifier or create a stable composite key in a separate working copy. Do not let a deduplication tool discard one of the variants to satisfy the comparator.

A key such as 000123 remains a string in the browser. If you open a CSV directly in spreadsheet software, however, leading zeroes can be lost due to automatic number conversion. Import such columns explicitly as Text. The comparator trims spaces around keys to match them; non-key data fields are compared as literal strings.

Do not mistake missing products for confirmed deletions

A REMOVED classification means absent from the second CSV, not necessarily deleted from a Shopify store or warehouse. A filtered export, missing location, timezone boundary or incomplete vendor feed can produce the same observation. Check that both files cover the same SKU universe before acting on differences.

The tool does not update stock, call ecommerce APIs or change your source files. Use the report as a review artifact. Back up original data and test a small batch before using results to modify inventory.

Frequently asked questions

Can I compare files if the columns are in different positions?

Yes. Exact header names link fields, so order does not matter. Renamed columns are considered schema differences.

Can I compare by email or customer ID instead?

Yes, if the column exists in both files and values are genuinely unique. Use a business identifier appropriate to the dataset.

Why does a removed product generate three audit lines?

The report includes each removed field so you can see original values. Product counts and field-level report line counts differ.

Is the report an automatic inventory update?

No. It is a local, downloadable review report with no Shopify or warehouse integration.

Related tools

Back to all data guides