Text & web utilities

CSV to JSON and JSON to CSV converter

Convert quoted CSV records into a JSON array or export a JSON object array as CSV without losing leading-zero text.

Your settings

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Generate result.

Report an issue

Try it, understand it

Explore the result

Observe quoted delimiters and preserved identifier strings.

Worked example comparison
ExampleOutputWhat to notice
Leading-zero identifiersConverted records2CSV code values remain strings.
A comma inside one cellConverted records1Quotation keeps New Delhi, India in one field.
JSON to quoted CSVConverted records1An embedded comma is quoted in the generated CSV.

Check your understanding

Why keep 001 as a string?

It may be an identifier whose leading zeros are meaningful. The converter does not guess types.

Can the input be a single JSON object?

Reverse conversion requires a nonempty array of objects, so wrap one record in an array.

Behind the tool

How this tool works

CSV parsing recognizes quoted commas, escaped double quotes and line breaks inside quoted fields. Each record must match the header width. CSV data remains text, avoiding accidental loss of identifiers such as 001. Reverse conversion takes the union of object keys, quotes fields when necessary and writes CRLF row separators.

THE OUTPUT RULECSV header names become object keys; JSON object keys become CSV columns

A worked example

A CSV column code containing 001 becomes the JSON string "001", not the number 1. A cell containing a comma is quoted in CSV and remains one value in the JSON object.

Good to know

At most 2,000 records, 100 columns and 50,000 cells. JSON must be a nonempty object array. Null and missing values become empty CSV cells; nested values remain JSON strings rather than being flattened. No automatic schema or type inference.

Quoted CSV cannot be parsed by splitting on commas

A CSV field can contain a comma or a line break when it is enclosed in double quotes. A double quote inside that field is represented by two double quotes. Splitting every line at each comma loses those boundaries. This converter tracks quote state and rejects malformed records instead of silently shifting columns.

CSV input values remain strings, preserving identifiers such as 001 and large digit sequences that are not quantities. The first row supplies unique nonempty object keys. Use the dummy data generator to create a small fixture, then convert it in both directions to inspect the representation.

JSON objects and CSV cells do not have identical types

JSON can contain nested objects, arrays, booleans and null. CSV is a row-and-column text format. Reverse conversion takes the union of keys across records; nested values are serialized as JSON text within a cell rather than expanded into new columns. Missing values and null become empty cells under the documented convention.

That convention means a round trip cannot preserve every JSON type or distinguish every empty value. A spreadsheet may also interpret formula-like text or leading-zero identifiers when it opens CSV. Inspect the destination application’s import options. The Base64 encoder is appropriate for byte-to-text transport, not for replacing a structured-data conversion.

A few questions, answered

Why keep 001 as a string?

It may be an identifier whose leading zeros are meaningful. The converter does not guess types.

Can the input be a single JSON object?

Reverse conversion requires a nonempty array of objects, so wrap one record in an array.

Find your calculator

Start typing to explore the library.