Home › Blog › Anonymize an Excel file

Anonymize an Excel (or CSV) file before giving it to an AI or sending it

Hiding a column or a sheet removes nothing from an Excel workbook: the data stays in the file, readable by anyone who receives it, AI included. To anonymize, you have to delete what identifies people, clean what the workbook hides, then check the copy before sending it.

Published · 9 min read

What an Excel workbook hides

An .xlsx file is an archive that contains much more than the cells shown on screen. Before sending it, or giving it to ChatGPT, Claude or Copilot, take stock of what it carries.

ItemWhat it can revealThe Document Inspector
Hidden rows, columns and sheetsNames, salaries, social security numbers set aside “for later”Removes them
Comments and notesInternal exchanges, author's name, remarks about a clientRemoves them
Document propertiesAuthor, last modified by, company, save pathRemoves them
Headers and footersName of the firm, the client or the file, visible only when printedRemoves them
Pivot table cacheEvery row of the source, even if the source sheet was deletedFlags it, does not remove it
External linksName and path of other workbooks (for example “Clients 2026.xlsx”)Flags them, does not remove them
Defined names and hidden namesRanges named after a client or a personFlags hidden names, does not remove them
Embedded objects and macrosAn entire PDF, Word document or other workbook dropped into a cellFlags them, does not remove them

The right-hand column follows Microsoft's help page on the Document Inspector: what it does not remove, it flags, because removing it could break the workbook. Those items must be handled by hand.

Three common traps

Do not ask the AI to anonymize the file itself: by the time it reads it, it has already received the names. Anonymization happens before, on your computer. An online anonymization service poses the same problem: see anonymizing online or offline.

The manual method in Excel

For a short workbook, five steps are enough. Always work on a copy: the Document Inspector warns that some deletions cannot be undone.

  1. Start again from values. The safest approach is often to create a new workbook and paste only the useful ranges into it, with Paste Special > Values. Formulas, links to other workbooks, defined names and objects stay in the original.
  2. Show everything before sorting. Unhide rows, columns and sheets, clear the filters: decide with full knowledge what goes out and what is deleted.
  3. Replace the identifiers. Replace each client, employee or supplier name with a code (Client_01, Employee_02) using Find and Replace, keeping the mapping table in another file, which never leaves. Delete the columns the task does not need: addresses, phone numbers, emails, IBANs, social security numbers.
  4. Run the Document Inspector. On Windows: File > Info > Check for Issues > Inspect Document, then Inspect and Remove All for each category. Then handle by hand what it flags without removing: external links (Data > Edit Links), embedded objects, hidden names, pivot table cache.
  5. Check. Reopen the copy, search (Ctrl+F, “Within: Workbook”) for three or four names from the original file, and look at File > Info for any remaining properties.

On a Mac, Microsoft's help page describes the Document Inspector for Windows; depending on your version of Excel, it may not be offered. Steps 1, 2, 3 and 5 apply in the same way. For other formats, see anonymize a Word document and remove a PDF's metadata.

Formulas to replace and mask

Over a few hundred rows, Find and Replace quickly becomes tedious. Four formulas do the same work reproducibly. They are written for English-language Excel, with the comma separator (in French Excel, the functions have French names and use “;”); UNIQUE, XLOOKUP and LET require Excel for Microsoft 365 or Excel 2021 and later. In the example, the “Clients” sheet has the names in column A and the IBANs in column C.

  1. Build the mapping table. In a new “Table” sheet, in A2: =UNIQUE(Clients!A2:A500) lists each name once. In B2, filled down: ="CLIENT_"&TEXT(ROW()-1,"000") gives CLIENT_001, CLIENT_002, and so on.
  2. Replace the names with their code. In the Clients sheet, in B2: =XLOOKUP(A2,Table!$A$2:$A$500,Table!$B$2:$B$500). The same client gets the same code on every row.
  3. Partly mask an IBAN. In D2: =LET(i,SUBSTITUTE(C2," ",""),LEFT(i,4)&REPT("*",LEN(i)-8)&RIGHT(i,4)) keeps only the first four and last four characters. For an AI, deleting the column is often simpler: it almost never needs an IBAN.
  4. Get the real names back in the answer. If the AI returns a table with the codes in column A: =XLOOKUP(A2,Table!$B$2:$B$500,Table!$A$2:$A$500), on your computer.

Before sending, freeze the result: copy the code columns, then Paste Special > Values, and delete the column of real names. Put the Table sheet in a separate file that stays at the firm: as long as the formulas exist, the names remain in the workbook. Also freeze the table itself as values once created, because UNIQUE recalculates it if the data changes, and the codes with it. Replacing names with codes is pseudonymization, not anonymization (see the difference under the GDPR).

The case of the CSV file

A CSV is a text file: one line per record, values separated by commas, semicolons or tabs. It contains no formulas, comments, properties or hidden sheets. Saving a sheet as CSV is therefore a simple way to get rid of everything a workbook hides.

But it removes nothing from the values: a CSV export of clients or employees contains every name, every address, every amount, in plain text. It is anonymized like everything else, column by column. Note also that a CSV keeps only one sheet, the one active when it is saved.

Typical cases: FEC, payroll, client lists, general ledger

FileWhat identifies peopleThe right reflex
FEC (French accounting entries file)Subsidiary account labels (clients, suppliers, employees), entry labels, document numbersDo not send it in plain form; for a question of method, an extract of a few lines with the names replaced; for the whole file, a dedicated tool (see What about the FEC?)
Payroll export, salary statementName, employee number, social security number, salary, absencesDelete the identity columns, keep employee codes, round or group if the amounts are enough to recognize someone
Client or contact listName, address, email, phone, IBANKeep only the columns the task needs, codes instead of names
General ledger, aged balanceThird-party labels, invoice references, unusual amountsReplace third parties with codes; an atypical amount can be enough to recognize a matter

For chartered accountants, the guidance note of the Conseil national de l'Ordre, “Comment utiliser ChatGPT ?” (How to use ChatGPT?), asks firms not to upload FECs, DSNs or client emails that have not been anonymized into tools the firm does not control. The framework is detailed in ChatGPT and chartered accountants. The principle applies to everyone: the AI only needs what serves the task. To build a formula, analyze a table structure or spot data-entry anomalies, ten fictitious or pseudonymized rows are almost always enough.

What about the FEC?

The fichier des écritures comptables (FEC, the French file of accounting entries) has a mandatory format: a flat file or an XML file, according to the specifications published by the tax authority. A flat FEC is a text file whose fields are most often separated by a tab or a vertical bar “|”. Third-party names are found mainly in the subsidiary account labels and the entry labels.

To anonymize an entire FEC while keeping its format, free tools are made for it:

In both cases, the publisher reminds you that you remain responsible for the result: check the processed file before sending it.

AnonymFiles is not a dedicated FEC tool. A FEC saved as .txt is read as raw text, line by line, not as a table. Renamed to .csv, it is read as a table if its fields are separated by tabs, but not with the vertical bar, which the app does not recognize as a separator. A FEC in XML format is not read. The copy produced is text, not a FEC that can be re-imported into accounting software, and each file is limited to 10 MiB, which a full-year FEC can exceed. AnonymFiles is useful when the FEC is just one document among others: an extract of a few lines, processed with the file's letters and contracts, under the same labels.

The method with AnonymFiles

The manual method suits an isolated workbook. When the spreadsheet is part of a file (letters, contracts, emails, scans), AnonymFiles processes everything together, on the computer:

  1. Drop in the folder. The .xlsx and .csv files are read along with the other documents. For a CSV, the separator (comma, semicolon or tab) is recognized automatically.
  2. A text copy, one table per sheet. Each sheet in the workbook becomes a Markdown table. Only cell values are kept, without formulas: no link to another workbook goes out. Images, charts and embedded objects are never copied. All sheets are read, hidden ones included: what was hidden becomes visible during review, instead of leaving without your knowledge.
  3. Detection. Names of people, organizations, addresses, emails, French-format phone numbers, IBANs from nine European countries, private dates and identification numbers are replaced with stable labels, such as [PERSONNE_1]. The same client keeps the same label in the spreadsheet, the letters and the emails of the file.
  4. Review. The copy is shown next to the original. One click masks what detection missed (an amount, an employee number, a label). Nothing is exported without approval.
  5. Export and return. The copy goes to the AI; the mapping table stays on the computer and never appears in the export. The app then puts the real names back into the AI's answer.

Limits to know: the copy of a spreadsheet is text, not a recalculable Excel workbook, and each spreadsheet is limited to 10 MiB. Old .xls files (Excel 97-2003) are read too, in the same way. The app works with no account and no telemetry; the license is checked on the computer, with no network call. On a Mac, the detection models are included: no connection. On Windows, they are downloaded once, at the first processing run, without any document text (see the security page). Price: €290 excl. VAT per seat per year for one or two seats, €240 excl. VAT per seat from three seats, quote above twenty seats.

Frequently asked questions

Is hiding a column enough to anonymize an Excel file?

No. A hidden column, row or sheet stays in the file: anyone who receives it can unhide it in two clicks, and an AI that reads the file reads it too. You have to delete the data, or send only a copy that does not contain it.

How do I remove hidden data from an Excel workbook?

On Windows, on a copy of the file: File, Info, Check for Issues, Inspect Document. The Inspector removes comments, properties, headers and footers, and hidden rows, columns and sheets. It flags without removing external links, embedded objects, macros, hidden names and the pivot table cache: those must be handled by hand.

Is a CSV file safer than an Excel file?

It hides fewer things: a CSV contains only text, with no formulas, comments, properties or hidden sheets. But all the values remain in plain text: a CSV of clients or employees must be anonymized like any other file.

Can I send a FEC or a payroll export to ChatGPT?

Not in plain form. The guidance note of the Conseil national de l'ordre des experts-comptables (the French accountants' national council) asks firms not to upload FECs, DSNs or client emails that have not been anonymized into a tool the firm does not control. For a question of method, an extract of a few lines with the names replaced is usually enough. To anonymize an entire FEC while keeping its format, free dedicated tools exist, such as anonymiser-fec.com.

What does AnonymFiles do with an Excel file?

It reads each sheet of the .xlsx, or the .csv, and makes a text copy (Markdown), one table per sheet. Only cell values are kept, without formulas; images, charts and objects are never copied. Names, addresses, emails, phone numbers and IBANs are replaced with stable labels, and the copy is reviewed before export.

Does AnonymFiles process hidden sheets?

Yes: all the sheets in the workbook are read, hidden or not, and appear in the copy. Nothing is sent without your knowledge: what was hidden becomes visible during review, where you decide what goes out.