CSV to JSONONLINE

Convert a CSV header row and records into a JSON array locally.

1 MiB per input · Ctrl / ⌘ + Enter to run

Every CSV cell becomes a JSON string. Headers must be unique and rows must have matching column counts.

Result
Ready. Paste input, then run the tool.
Your JSON stays in your browser. Core processing happens locally.
THE PRACTICAL GUIDE

Convert CSV to JSON while retaining text such as leading zeros

CSV to JSON assigns names from a header row to cells in each following row. It gives you an array of records that can be searched, edited, or sent to an API.

When should you use it?

  • Move a spreadsheet export into a JSON workflow.
  • Preserve leading zeros in account identifiers.
  • Inspect quoted commas and line breaks as cell values.
WORKED EXAMPLE

Example: keep leading zeros

Both cells remain strings, so the identifier is not converted to the number 1.

CSV input
id,name
001,Alex
JSON output
[{"id":"001","name":"Alex"}]

Treat the header and quoting as part of the format

The header row supplies object keys. A quoted cell can contain a comma, a quote escaped by another quote, or even a line break. Those are ordinary CSV cases, which is why splitting the text on commas or newlines can create incorrect records. Check the first converted row against the original header before processing the whole output.

Convert types only after you know the field meaning

This tool keeps every cell as a string. That preserves a postal code such as 00123 and avoids guessing whether a date is day-first or month-first. If an API requires numeric quantities or booleans, convert those specific fields deliberately after import. An empty cell remains text too; decide in your application whether it means an empty string, a missing value, or null.

AT THE WORKBENCH

Turn rows into named records.

The first CSV row supplies property names. Quoted commas, line breaks, and doubled quotes are parsed without executing cell formulas.

  1. Open CSV

    Paste text or choose a local UTF-8 CSV file.

  2. Check the columns

    Headers must be nonempty and unique; irregular rows receive an error.

  3. Export JSON

    Copy or download an array of objects with text values.

IN PRACTICE

How do I convert CSV to JSON without losing leading zeros?

Use a header row and import the CSV as text. The converter deliberately keeps every cell as a JSON string, so identifiers such as 00123 and values that look like dates remain unchanged. Convert selected fields to numbers later only when the application contract requires it.

CSV input and resulting JSON record

text
CSV:  id,name
      00123,Alex
JSON: [{"id":"00123","name":"Alex"}]

Quoted commas and line breaks are supported. Duplicate or empty headers and rows with the wrong number of cells produce errors.

No. Formula-like text such as =SUM(A1) remains a string in JSON. If you later export it to a spreadsheet, review the receiving application’s formula behavior.

BEFORE YOU USE THE RESULT

What should you check before using the result?

No type inference occurs: 42, true, and dates remain strings. Rows must match header width, with at most 100 columns and 200,000 cells.

Why values remain strings

Values such as 001, long account numbers, dates, and =SUM(A1) should not be silently reinterpreted. The converter keeps them as text so you can choose types deliberately in a later step.

CSV boundaries

The input is limited to 100 columns and 200,000 cells. It expects comma separation and a header row. Empty cells become empty strings; it does not infer null, booleans, or numbers.

Learn spreadsheet conversion

Technical reference: CSV records and quoting · RFC 4180

THE JSON FIELD GUIDE
All guides