SPARKPOND / GUIDE

CSV Formula Injection: Risks and Safe Exports

A spreadsheet may interpret cells beginning with =, +, -, @, tab or carriage return as formulas when a CSV opens.

Problem symptoms

  • A cell runs a function when opened.
  • Phone numbers beginning with + are interpreted unexpectedly.

Why it happens

  • CSV has no type metadata.
  • Spreadsheet software auto-interprets cell text.

Example before and after

Before

name,note
Ada,"=HYPERLINK(...)"

After

name,note
Ada,"'=HYPERLINK(...)"
Download example ↓

Procedure

  1. Scan first characters after whitespace.
  2. Review every flagged cell.
  3. Choose a destination-safe text prefix.
  4. Validate the serialized export before download.
Convert CSV to Excel XLSX →

Common mistakes

  • Executing the file to see whether it is safe.
  • Removing every leading plus sign without review.

Other possible solutions

  • Import the column explicitly as text in the destination spreadsheet.

Important limitations

  • Spreadsheet behavior varies; no CSV can control every consumer.

Related guides

How to Preserve Leading Zeros in CSV Files

Leading zeros disappear when identifiers are interpreted as numbers rather than text.

How to Convert Excel XLSX to CSV Without Excel

A browser can read XLSX values locally and serialize each selected sheet as a separate CSV.