CSV Header Only – Why CSV to JSON Returns an Empty Array

Local only

A CSV file containing only column names has zero data records, so CSV to JSON correctly returns an empty JSON array.

9 chars · 1 line

9 chars · 1 line

1 row2 columnsComma delimiter

CSV empty-dataset troubleshooting

Why header-only CSV becomes an empty JSON array

The preloaded CSV defines name and role but contains no later records. The converter uses the first row only as keys, so there are zero objects to emit and the result is an empty array. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • CSV to JSON behavior example
  • Header-to-key mapping
  • String-preserving cell conversion
  • .csv and .tsv file import
  • Browser-local processing

Steps

  1. Verify that the first row really is a header.
  2. Look for at least one complete record after it.
  3. If the empty dataset is intentional, keep [] as the correct JSON representation.

Headers define shape but do not create records

A header tells the converter which property names to use. It does not represent a data object by itself, so a header-only file naturally maps to an empty array.

CSV Header Only, No Data Rows example

The output below is the actual JSON produced by the same CSV to JSON mode for the preloaded source.

CSV input

name,role

Actual JSON output

[]

Common questions

Frequently asked questions

Is [] an error for a header-only CSV file?

No. It accurately represents zero data rows.

Why is the header not returned as a JSON object?

Header cells become property names, not record values.

What should I check if I expected data?

Confirm the export actually wrote records below the header and that you imported the complete file.

Debugging a specific CSV issue? Browse CSV troubleshooting.