Map Extract
Free tool

Convert CSV to JSON

Paste a CSV and get JSON in the shape your next tool expects: a plain array of objects, an object keyed by an ID column, or JSON Lines with one record per line. Numbers, true and false and empty cells can be typed for you, and headers like contact.email can become nested objects.

Runs in your browser. Nothing you enter is uploaded.

Two leads, typed and nested

This CSV has dotted headers for the contact details, a review count and a yes/no field, and the second business is missing an email and a review count.

With Detect numbers, true/false and empty values and Nest dotted headers both ticked, 48 becomes a number, true and false become booleans, blank cells become null, and the two contact columns are folded into a contact object. Phone numbers with spaces stay as text. The Column types found table under the output confirms it: reviews is a number with one empty value, verified is true/false.

Input
id,business,contact.email,contact.phone,reviews,verified
KC1,Kiln & Co Pottery,hello@kilnandco.example,01632 960410,48,true
MP2,Marlow Print Works,,01632 960411,,false
Result
[
  {
    "id": "KC1",
    "business": "Kiln & Co Pottery",
    "contact": { "email": "hello@kilnandco.example", "phone": "01632 960410" },
    "reviews": 48,
    "verified": true
  },
  {
    "id": "MP2",
    "business": "Marlow Print Works",
    "contact": { "email": null, "phone": "01632 960411" },
    "reviews": null,
    "verified": false
  }
]

Converting

  1. Paste the CSV

    Paste the data with its header row. The separator is detected, or choose comma, semicolon, tab or pipe.

  2. Decide on types

    Leave Detect numbers, true/false and empty values on for typed JSON. Turn it off if every value must stay a string, for example when IDs look like numbers.

  3. Nest if needed

    Tick Nest dotted headers when column names like address.town should become nested objects.

  4. Choose the shape and indent

    Array of objects, Object keyed by the first column or JSON Lines. Indent with 2 or 4 spaces, or minify for the smallest file.

  5. Copy or download

    Copy the JSON or save it as data.json. The note shows how many objects were written.

Which output shape to pick

ShapeLooks likeUse it for
Array of objects[ {...}, {...} ]Most APIs, automation tools and JavaScript code
Keyed by first column{ "KC1": {...}, "MP2": {...} }Lookups by ID, config files
JSON Linesone {...} per lineLarge files, streaming imports, logs and many data pipelines

Typing values safely

Type detection only turns a cell into a number when it really is one. A phone number written with spaces stays a string; the value 01632960410 also stays a string, because turning it into a number would drop the leading zero. Very long digit strings, such as card-like IDs or tracking numbers, are kept as text for the same reason.

Turning detection off gives you strings everywhere, which some systems prefer: the receiving end then decides what is a number. Either way, check the column types table before you send the JSON to anything that will reject a field of the wrong type.

Questions people ask

How do I convert a CSV file to JSON?

Paste the CSV or its contents into the box, keep First row is a header ticked, and the JSON appears on the right as an array of objects whose keys are your column names. Choose another shape or indent if you need one, then copy the result or download it as a .json file.

Will numbers in my CSV become JSON numbers?

Yes, when detection is on. Plain numbers such as 48 or 4.6 become numbers, true and false become booleans, and empty cells become null. Values that would change if converted, such as numbers with leading zeros or very long digit strings, stay as text so nothing is lost.

What is JSON Lines?

JSON Lines, sometimes called NDJSON, puts one complete JSON object on each line with no surrounding array. It is easy to append to and to process one record at a time, so many data pipelines, log tools and bulk import endpoints accept it. Choose JSON Lines under Output to produce it.

What if my CSV has no header row?

Untick First row is a header and each row becomes an array of values instead of an object, so the output is an array of arrays. That suits code that knows the column order. To get named keys, add a header line to the top of the CSV before converting.

Where your data goes

The conversion runs in JavaScript on this page. Your CSV, and the JSON made from it, are not uploaded to Map Extract or any other service.

Checked against the tool on

Top