Excel to JSON: How Column Headers Become JSON Property Names
Table of Contents
When you convert an Excel spreadsheet to JSON, the column headers in row 1 become the property names (keys) in each JSON object. Understanding this mapping — and how to prepare your headers — makes the difference between clean, usable JSON and output that requires manual cleanup.
How Row 1 Column Headers Become JSON Property Names
The converter reads row 1 of your spreadsheet as the header row. Each column header becomes a key in every JSON object. Every subsequent row becomes one JSON object in the output array.
Example spreadsheet:
| Name | Score | |
|---|---|---|
| Alice | [email protected] | 92 |
| Bob | [email protected] | 87 |
Output JSON:
[
{ "Name": "Alice", "Email": "[email protected]", "Score": 92 },
{ "Name": "Bob", "Email": "[email protected]", "Score": 87 }
]
The header names appear exactly as written — capitalization, spaces, and special characters are preserved in the output.
Best Practices for Column Header Names Before Converting
Clean header names in Excel produce clean JSON keys. Before converting, review your headers:
- Avoid spaces:
First Namebecomes"First Name"in JSON — valid, but harder to use in JavaScript dot notation. UsefirstNameorfirst_nameinstead. - Avoid special characters: Headers with
/,(,),#, or%create keys that require bracket notation in code:obj["Revenue (USD)"]. - Avoid duplicate names: Two columns with the same header — e.g., two columns both named "Total" — will cause only the last column's values to appear in each JSON object. Rename duplicates before converting.
- Keep them short: Long headers make JSON verbose and harder to read.
Empty Headers and Merged Cells: What to Expect
Empty header columns: If a column in row 1 has no header, the converter assigns a placeholder name like "__EMPTY" or "Column3" depending on the tool. These columns still appear in the JSON output.
Merged header cells: Excel allows merging cells in row 1 to create visual groupings. When merged cells are used as headers, only the leftmost cell contains the actual value — adjacent merged cells are empty. This creates the empty header issue above.
Fix: Unmerge all cells in row 1 before converting. Give each column a unique, descriptive name. This takes 2 minutes and produces much cleaner JSON.
Renaming JSON Keys After Export
If your Excel file uses verbose or inconsistent header names and you cannot change the source file, you can rename keys after exporting to JSON.
Using a text editor: For small files, find-and-replace works: replace "First Name": with "firstName": throughout the file.
Using JavaScript:
const data = require("./data.json");
const renamed = data.map(row => ({
firstName: row["First Name"],
email: row["Email Address"],
score: row["Test Score"]
}));
console.log(JSON.stringify(renamed, null, 2));
This approach lets you normalize any header naming convention into whatever key format your code expects.
How the Converter Handles Data Types in Each Column
Beyond key names, the converter also auto-detects data types in each column:
- Numbers: Cells containing numbers become JSON numbers:
92not"92" - Booleans: TRUE/FALSE cells become
true/false - Dates: Date-formatted cells become date strings (ISO format where possible)
- Empty cells: Empty cells become
nullin the JSON output - Text: All other values become strings
If a number column contains a mix of numbers and text (like "N/A"), the entire column may be treated as strings. Keep columns consistent for the cleanest output.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free Excel to JSON ConverterFrequently Asked Questions
How does the Excel to JSON converter handle column headers?
Row 1 of your spreadsheet is treated as the header row. Each column header becomes a property name (key) in every JSON object. Rows 2 onward each become one JSON object in the output array.
What happens if two columns have the same header in Excel?
Duplicate column headers cause only the last column's values to appear for that key in the JSON output. Rename duplicate columns before converting to preserve all data.
Can I convert Excel to JSON without using the first row as headers?
Most browser-based converters assume row 1 is always the header row. If your data has no headers, add a row of column names at the top before converting, then remove or ignore them after.
Why do my JSON keys have spaces in them after converting?
JSON keys preserve the exact text of your Excel column headers, including spaces. To get keys without spaces, rename your Excel column headers to use camelCase or underscores before converting: "FirstName" or "first_name" instead of "First Name".

