toolgarden.xyz
中文
Excel to JSONXLSXdata conversionJSON

How to Convert Excel Data to JSON Online

Excel to JSON usually turns the first row into field names and each following row into a JSON object for mock APIs, imports, and config migration.

ToolGarden tools prioritize browser-local processing, so files and text do not need to be uploaded to a server.

Published July 2, 2026Updated July 3, 20268 min readBy ToolGarden

The basic rule for Excel to JSON is simple: headers become field names, and each row becomes a JSON object.

[
  {
    "name": "Alice",
    "email": "alice@example.com",
    "active": true
  }
]

Clean the Sheet Before Conversion

  • Use the first row as field names and avoid empty or duplicate headers.
  • Keep each column to one kind of data.
  • Decide whether date columns should remain text or become date strings.
  • Remove merged cells, notes, and summary rows before conversion.
  • If the file has multiple sheets, confirm which sheet the tool reads.

How to Represent Nested Fields

Many APIs expect nested objects, while Excel is a flat table. A common approach is to use path-like headers such as user.name, user.email, and order.id, then rebuild those paths into nested JSON.

[
  {
    "user": {
      "name": "Alice",
      "email": "alice@example.com"
    },
    "order": {
      "id": "A-1001",
      "total": 59.9
    }
  }
]
Excel headerJSON resultBest for
user.nameuser: { name: ... }Profiles and contacts
order.totalorder: { total: ... }Orders, quotes, and billing data
tagstags: ...Simple tag columns that can later become arrays
address.cityaddress: { city: ... }Addresses, regions, and shipping data

Handle Empty Values, Dates, and Numbers Carefully

A cell that looks like text in Excel may actually be a number, a date serial value, or a formatted cell. IDs, phone numbers, and postal codes should usually stay as text so leading zeros are not lost. Amount fields need decimal checks.

  • Save IDs, phone numbers, and postal codes as text when needed.
  • Check decimal places for amounts, quantities, and ratios.
  • Normalize dates to yyyy-mm-dd or ISO strings before sending them to an API.
  • Decide whether blank cells should become null, empty strings, or omitted fields.

Common Issues

IssueCauseSuggestion
Strange field namesHeaders contain spaces, line breaks, or duplicatesNormalize headers first
Numbers become textCell formats are inconsistentCheck key fields after conversion
Empty values changeDifferent blank-cell rulesNormalize according to API needs
Dates look wrongExcel dates may be serial valuesConvert dates to text first

Checklist Before Importing to an API

  1. Convert a small sample first and confirm field names and nested structure.
  2. Use a JSON formatter to verify that the output is valid JSON.
  3. Spot-check the first row, a middle row, and the last row to catch empty or summary rows.
  4. Compare required fields, field types, and date formats with the API documentation.
  5. Keep the original Excel file before a production import.

Frequently asked questions

Q.Why do Excel dates turn into a random number in JSON?

Excel stores dates as serial numbers underneath (1900-01-01 is 1, each day adds 1), so 45678 is really a date. If the converter reads the raw cell value, you get a meaningless integer like 45000 instead of a date. Two fixes: before conversion, format the date column as Text in Excel or add a helper column with =TEXT(A2,"yyyy-mm-dd") and convert that one; or use a converter that detects Excel date formats and outputs ISO strings like 2024-11-15. Always spot-check a few date fields before pushing the JSON to production.

Q.Why do phone numbers and long IDs turn into scientific notation in JSON?

Excel displays numbers longer than 15 digits in scientific notation (3.10105E+17) and only keeps 15 digits of precision. Everything past digit 15 becomes zero. That is why 18-digit Chinese ID numbers lose the last three digits and 19-digit bank card numbers get mangled. The root cause is that these fields are treated as numbers. Fix: set those columns to Text format in Excel before conversion, or prefix values with an apostrophe ('110101199001011234) so Excel stores them as text. Also confirm the converter reads them as strings, not numbers.

Q.Which sheet does the tool read when my Excel has multiple sheets?

Most online converters default to the first sheet (the leftmost tab). If your data is on another sheet, the output will be empty or wrong. Fix: drag the target sheet to the first position before uploading, or copy its content into a new Excel file. If the tool supports sheet selection, name the sheet explicitly. To convert all sheets, you often need to loop. ToolGarden Excel to JSON currently reads the first sheet by default, so merge or split before importing multi-sheet data.

Q.The JSON output has spaces or line breaks in field names and my API rejects it; how do I fix that?

The header is the problem. Excel allows headers like "user name" or "order\nid" with spaces or line breaks, and those become JSON keys directly: { "user name": "Alice", "order\nid": "A001" }. Most APIs reject keys with spaces or special characters. Fix: normalize headers in Excel first; replace spaces with underscores (user_name), rename to lowerCamelCase (orderId), and remove line breaks. You can also run the output through a JSON cleanup tool to rename keys in bulk. Doing it once per template keeps every future conversion clean.

Q.Should empty cells become null, empty string, or omitted in JSON?

It depends on the API contract, and all three are valid but mean different things. null explicitly says the field exists but has no value, matching database NULL. An empty string means the field has a value that happens to be empty, common for form defaults. Omitting the key means the property does not exist, useful for optional or sparse data. Picking the wrong one can break the backend; for example, if the server checks `if field is None` but you send "", the condition fails. Confirm the contract, or post-process with a JSON tool to standardize.