The app needs JSON, and the data is in a spreadsheet

DataFileConverter » Use cases » Excel to JSON for an app

Download DataFileConverter Free Trial »     Buy DataFileConverter Now »

The situation

Somebody needs the data as JSON - an application's seed file, an API payload, a configuration file, a fixture for a test - and the data lives in an Excel workbook or a CSV export. Writing a one-off script is the usual answer, and it is also where the time goes: quoting, headers, empty cells, numbers that came back as strings.

If it is a repeating job (a price list refreshed monthly, a product catalogue) the script has to be maintained too, which is more work than the conversion itself.

What you do

  1. Choose the Excel file and the sheet to convert.
  2. Set JSON as the destination, and check the preview - the mapped columns are shown before anything is written.
  3. Convert. For many files, use batch mode and point it at a folder.

Converting an Excel sheet to JSON with DataFileConverter

The column names become JSON keys, values keep their type, and nested data in a cell is parsed into JSON structure rather than left as a string. The workbook is never modified, and everything runs locally - the file does not have to be uploaded to a converter website.

What it will not do

If the shape is not what the app expects

Two common next steps: adjusting the mapping (see converting between multiple formats), or asking whether the application would be happier with CSV or SQL. If the destination is a database rather than an app, FileToDB loads files into databases directly.

Related

Converting Excel to JSON in the browser: Excel to JSON. Step-by-step guide: Excel to JSON. Other directions: JSON to CSV, CSV to JSON. Batch conversion: batch convert.