When CSV columns shift, check the quotes
An address gains an extra column because it contains a comma. A note turns into two records because it contains a line break. CSV can carry both values, but the reader needs a way to tell data from separators. File syntax and spreadsheet type conversion are separate problems, even when both appear during the same import.
Quote the whole field when it contains a separator
The format described by RFC 4180 §2 encloses fields containing commas, line breaks or double quotes in double quotes. A quote inside such a field is doubled. RFC 4180 is Informational: it documents a common format rather than establishing an Internet Standard followed identically by every CSV application.
From a cell value to CSV text
Do not add a cosmetic space after a closing quote: a reader may reject that field. Backslash-escaping a quote as though the file were JSON is not this CSV convention either.
| Cell value | CSV representation |
|---|---|
| Osaka | Osaka |
| Osaka, Japan | "Osaka, Japan" |
| He said "yes" | "He said ""yes""" |
| Leading or trailing spaces | Spaces are data; do not silently trim them |
Visible lines are not always CSV records
Inside a quoted field, a line break belongs to the cell. Splitting a file into lines and then splitting each line at commas cannot parse this reliably. The following file has two data records; only the note for A-1 spans two lines.
A multiline field
RFC 4180 describes CRLF record separators. Files using LF are also common, and Online Tools CSV Diff accepts CRLF, LF and CR. Line breaks inside quotes remain part of the value, so changing those characters can still produce a cell difference even when the displayed text looks alike.
id,note
A-1,"first line
second line"
B-2,"He said ""yes"""
Use a key column when rows can move
A line-by-line diff can bury a price change under a sort order change. CSV Diff matches records by a unique column such as id and compares their values as strings.
Only the price of A-1 changes
Put the two CSV documents in separate inputs and select id as the key. The result is one price change for A-1, from 100 to 120. Do not paste the explanatory --- after --- separator. Column order is ignored, but both documents must have the same column names. Empty or repeated column names and empty or repeated key values are rejected.
id,price
A-1,100
B-2,200
--- after ---
id,price
B-2,200
A-1,120
CSV quotes do not declare a spreadsheet text type
Writing "00123" uses CSV quoting; it does not instruct Excel to keep that column as text. If Excel converts the value to a number, leading zeros can disappear. Long identifiers can also lose digits through numeric precision limits.
Choose the column type while importing
Microsoft documents importing the column as text, and automatic-conversion settings in supported versions. Keep the original CSV and choose the ID column’s type before loading the data. Formatting a cell after digits were lost cannot restore those digits. See Microsoft’s guidance on leading zeros and large numbers for version-specific options.
A BOM helps identify encoding, not column types
If Japanese text becomes garbled while the columns remain aligned, look at the encoding selection. Microsoft documents normal opening of UTF-8 CSV with a BOM and an import route for files without one. A BOM does not declare a delimiter, a header row or the intended type of an ID column.
What the Online Tools converter writes
With comma selected, JSON to CSV quotes fields where needed and uses CRLF between records. Its download adds a UTF-8 BOM; copied output does not include that download prefix. CSV quoting also does not neutralize spreadsheet formulas. The way a spreadsheet interprets values from an outside source needs its own import policy.
Try conversion and comparison on the same small table
CSV Diff accepts comma-separated input with a header row. To produce a table from JSON, use JSON to CSV. CSV Diff limits each input to 500,000 characters, data to 10,000 rows and results to 10,000 changes; narrow a large comparison to the relevant records.
Related reading and specifications
See Choosing data formats and Text encoding basics. Quoting conventions are documented in RFC 4180 §2; encoding import behavior is covered by Microsoft’s UTF-8 CSV guidance.