Does JSON.parse change your numbers?

Sometimes, yes — before your code has done anything at all. 1.10 comes back 1.1. The 17-digit order id 9007199254740993 comes back 9007199254740992 — a different number. Paste a file below and see what the standard library would do to yours. The check runs in your browser; your JSON goes nowhere.

3 of 3 numbers would not survive JSON.parse — and for 1 of them it is not even the same value any more.

WhereYou wroteJSON.parse emitsVerdict
$.total1.101.1text re-written, value kept
$.order_id90071992547409939007199254740992value changed
$.quantity1e31000text re-written, value kept

Why this happens

JavaScript has one number type, a 64-bit float. The moment JSON.parse reads a number, the text your file stored becomes that float: integers past 253 snap to the nearest one it can hold, trailing zeros vanish because a float has no memory of them, and 1e3 and 1000 become indistinguishable. Serialise it back out and the file has been rewritten — usually silently, occasionally incorrectly.

For arithmetic that is often fine. For invoice amounts, database ids, account numbers, version strings that look numeric, or any file you diff or convert, it is data loss with no error message.

What the verdicts mean

  • Value changed — parsing produces a genuinely different number: the id above, or 1e400 collapsing to null. This is the one that corrupts data.
  • Text re-written, value kept — 1.10 → 1.1, 1e3 → 1000. Arithmetic survives; anything that compares, diffs, or round-trips the file sees a change it never asked for.

The comparison behind the verdicts is exact string arithmetic over the decimal texts — no floating point judges floating point.

The tools here do not do this

Every JSON conversion on this site reads numbers with a scanner that keeps them as the text you wrote — the same scanner this page runs, published as open source as @localcsv/json-scan on npm. So JSON to CSV carries 1.10 into the CSV as 1.10, and CSV to JSON writes your values back without retyping them. If your data has already been through a lossy parse, the health check can help you see what state it is in. Excel does the same to a CSV on opening — leading zeros, long ids, SEPT2 — and that checker is this page's twin.