CSV to JSON Numbers as Strings – Why Numeric-Looking Cells Stay Quoted

Local only

CSV text does not reliably distinguish numbers from numeric-looking identifiers, so CSV to JSON keeps numeric-looking cells as JSON strings.

12 chars · 2 lines

12 chars · 2 lines

2 rows2 columnsComma delimiter

CSV type-preservation behavior

Why CSV to JSON keeps numbers as strings

Both 42 and 37 look numeric, but CSV itself does not declare a type for either column. VetaTool therefore emits strings rather than guessing that one or both should become JSON numbers. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • CSV to JSON behavior example
  • Header-to-key mapping
  • String-preserving cell conversion
  • .csv and .tsv file import
  • Browser-local processing

Steps

  1. Convert CSV cells without automatic type inference.
  2. Use a schema or known column list to identify real numeric fields.
  3. Convert only those properties to JSON numbers after parsing.

Text that looks numeric may still be an identifier

Account IDs, postal codes, versions, and product codes can contain only digits but must remain text. Avoiding automatic numeric coercion protects those values.

CSV Numbers as JSON Strings example

The output below is the actual JSON produced by the same CSV to JSON mode for the preloaded source.

CSV input

id,age
42,37

Actual JSON output

[
  {
    "id": "42",
    "age": "37"
  }
]

Common questions

Frequently asked questions

Why is 42 returned as "42"?

Because CSV does not carry a reliable number type and VetaTool preserves cell text.

Can I convert an age column to numbers afterward?

Yes. Apply an explicit transformation to known numeric columns.

Does this help preserve large identifiers?

Yes. Keeping CSV cell text as strings avoids JavaScript number precision changes during CSV-to-JSON conversion.

Debugging a specific CSV issue? Browse CSV troubleshooting.