convertCASEpro

MODE

CSV to JSON Converter

Paste CSV and get an array of JSON objects, or an array of arrays if there is no header.

INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0

How the CSV to JSON Converter works

The parser follows the common CSV rules: fields can be wrapped in double quotes, quoted fields may contain commas and line breaks, and a doubled quote stands for a literal quote. The delimiter can be detected automatically from the first lines or picked from comma, semicolon, tab and pipe.

With the header option on, the first row supplies the key names. Type conversion turns values such as 42, 3.5, true, false and null into real JSON types, while everything else stays a string. Leading zeros are preserved only when conversion is off, since a number like 007 is not valid JSON as a number.

When it is useful

  • •Turning a spreadsheet export into data for a script or API.
  • •Preparing seed data for a web app from a CSV.
  • •Inspecting the structure of a file before writing an importer.
  • •Converting European semicolon separated exports.

Frequently Asked Questions

What if a column has leading zeros, like ZIP codes?

Turn off type conversion so that 02134 stays a string. With conversion on it would become the number 2134.

Can it handle commas inside fields?

Yes, as long as the field is wrapped in double quotes, which is how spreadsheet programs export such values.

How do I convert JSON back to CSV?

This tool goes one way. For tabular output you can paste a spreadsheet selection into the Markdown Table Generator.

Related tools

[ Browse all tools ]