Skip to content

How to Clean a CSV Before Sharing It

A CSV that looks fine on your screen can still carry a private column, a duplicate customer, dates nobody can read the same way twice, and a cell that turns into a live formula on someone else's computer. Here is a short routine that catches all of that, with a worked example you can follow.

Reading time: about 8 minutes · Last updated: 12 November 2026

On this page

What goes wrong when a CSV is shared as-is

CSV is the most forgiving file format there is, which is exactly why it causes trouble. Anything can sit in a cell, and nothing warns you about it. The problems that show up most often when a file leaves your hands are these:

None of these needs a programming language to fix. The routine below uses five free Toolsfy tools that read the file in your browser.

The example file

Here is a small customer export with every one of those problems. Copy it into a text file called customers.csv if you want to follow along.

Customer ID,Name,Email,Signup date,Amount,Internal note
00142,  Priya   Sharma ,PRIYA@EXAMPLE.COM,03/04/2026,"1,250.00",called twice
00143,Rahul Verma,rahul@example.com,05/04/2026,980,
,,,,,
00142,Priya Sharma,priya@example.com,03/04/2026,"1,250.00",duplicate from import
00144,"=HYPERLINK(""http://example.com"",""Click me"")",anil@example.com,07/04/2026,"2,100.5",check

Count the issues: an internal column, extra spaces in a name, a completely empty row, dates in day/month/year order, amounts written three different ways, Priya listed twice, and a name cell that is really a hyperlink formula. The dates in this file use the Indian day/month/year convention, so 03/04/2026 means 3 April.

Step 1: Look before you change anything

Open the file in the CSV Viewer & Editor. It shows the data as a table with a row count, which is the quickest way to spot surprises: here it reports 5 data rows, one of which is entirely blank.

Two habits are worth building at this stage. First, use the search box to look for anything that should not leave your organisation — words like “internal”, “salary” or a colleague's name. Second, if you sort, choose whether the column is compared as numbers or as text. Sorting amounts as text puts 980 after 2,100.5, because text sorting compares characters, not values.

Do not fix things here yet. The point of this step is to know what you are dealing with.

Step 2: Remove columns the recipient should not see

Load the file into Column Extractor / Reorderer and untick Internal note. The tool shows the output order as a single line — Customer ID → Name → Email → Signup date → Amount — so you can confirm exactly what will be exported. You can also rename headers or move columns up and down if the recipient expects a particular layout.

Click Download CSV. The status line tells you that 1 cell received a leading apostrophe; that is the hyperlink formula, and Step 5 explains why.

Removing the column is better than hiding it. A hidden spreadsheet column is still in the file; a column that was never exported is not.

Step 3: Fix spacing, empty rows, dates and numbers

Open the downloaded file in the Data Cleaning Tool. It applies its steps in a fixed, visible order: remove fully empty rows, trim, normalise whitespace, change case, reformat dates, reformat numbers. For this file, use these settings:

The summary should read: 5 input rows, 4 output rows, 1 removed empty row, 9 changed cells and 0 flagged values. The nine changes are the trimmed name, the four dates and the four amounts. The Before / after tab lists each one, so nothing changes without you seeing it.

Notice what did not change. Customer ID was not selected for number formatting, and even if it had been, the tool skips values with leading zeros or more than 15 digits unless you explicitly allow it. That protection matters: 00142 is a label, not a quantity.

Why ISO dates? A date written as 2026-04-03 reads the same way in every country and sorts correctly as plain text. If the recipient prefers 03/04/2026, choose that format instead — but only once you are sure which convention they use.

Step 4: Remove duplicate rows

Now load the cleaned file into the Duplicate Row Remover. Comparing whole rows would miss Priya's duplicate, because one copy has her email in capitals. Instead:

  1. Choose Selected columns only and tick Email.
  2. Tick Ignore letter case.
  3. Set Keep to Last occurrence, because the later row has the lower-case email you want to keep.

The counts show 4 input rows, 3 kept and 1 removed. Open the Removed rows tab to confirm it is the capitalised copy, then download the cleaned CSV. If you need a record of what was dropped, Download removed rows saves it as a separate file.

The case option only affects the comparison. The row that is kept is written exactly as it was, and kept rows stay in their original relative order — which is why the output now starts with Rahul (row 2 of the cleaned file), followed by Priya and Anil.

Step 5: Check for formula-like cells

The Name cell for customer 00144 contained =HYPERLINK("http://example.com","Click me"). Opened in a spreadsheet, that is not a name; it is a clickable link to a website. In a real attack the link, or a more harmful formula, would be the whole point.

Every CSV download on the Spreadsheet & Data tools has Spreadsheet-safe CSV switched on by default. It adds an apostrophe in front of any cell that starts with =, +, -, @ or a tab, unless the cell is a plain number such as -12.5. Spreadsheet apps treat a leading apostrophe as “this is text”, so the cell is shown instead of being run. The status line tells you how many cells were changed, so you can review them; in this file it was one, back in Step 2.

You can untick the option for data you fully trust, but for anything that came from a web form, a customer, or another system, leave it on.

The finished file

Customer ID,Name,Email,Signup date,Amount
00143,Rahul Verma,rahul@example.com,2026-04-05,980.00
00142,Priya Sharma,priya@example.com,2026-04-03,1250.00
00144,"'=HYPERLINK(""http://example.com"",""Click me"")",anil@example.com,2026-04-07,2100.50

Three customers, one row each, no internal notes, consistent dates and amounts, IDs intact, and the formula neutralised. It is worth one last look in the CSV Viewer & Editor before you attach it. The 00144 name obviously still needs a human decision — the tools made it safe, not correct.

If the recipient opens it in Excel

A CSV file has no way to say “this column is text”. When someone double-clicks it, Excel guesses, and 00142 becomes 142. If the recipient will use Excel, you have two options:

A two-minute checklist

  1. Search the file for anything internal or personal that the recipient does not need.
  2. Export only the columns they need, in the order they expect.
  3. Trim spaces and remove empty rows.
  4. Choose the date order deliberately and convert to an unambiguous format.
  5. Make amounts consistent, but leave IDs alone.
  6. Remove duplicates using the column that identifies a record, such as email or customer ID.
  7. Keep spreadsheet-safe export on unless you trust every cell.
  8. Open the final file once before you send it.

FAQs

Why not do all of this in Excel?

You can, but opening a CSV in Excel is often where the damage happens: leading zeros disappear and some text is converted to dates automatically. Cleaning the CSV first, and then deciding how it should be opened, avoids that.

Can I clean only some columns?

Yes. In the Data Cleaning Tool, the text, date and number steps each have their own column list. To change case in one column only — for example, upper-casing country codes — select just that column for the text steps and run the tool again.

What happens to values that cannot be converted?

They are listed under Flagged values with the row, column and reason, and left exactly as they were. For example, 31/02/2026 is not a real date, so it is flagged rather than guessed.

Are my files uploaded?

These tools read and write the file in your browser; the CSV is not sent to Toolsfy. Our Privacy Policy describes what the site itself does collect, such as analytics on content pages like this one.

Wrapping up

Cleaning a CSV is mostly about being deliberate: decide what leaves, decide how dates and numbers should read, and make sure nothing in the file can act on its own. The five steps above take a couple of minutes once you have done them once, and the same tools work for files with thousands of rows. All of them are collected on the Spreadsheet & Data Tools page.