Data & APIs

How to Convert Spreadsheet Data to JSON Safely

Prepare headers, preserve leading zeros, and validate rows when converting Excel or Google Sheets data to JSON.

Photorealistic editorial photo for Spreadsheet To Json
Data & APIs · Practical ideas for your next build

Copying a spreadsheet range usually produces tab-separated text. That makes TSV a useful bridge between a worksheet and an API payload. Before conversion, decide what each row represents and which columns must remain text. Most data problems begin in the worksheet rather than in JSON serialization.

Prepare one header row

Use unique, non-empty names such as customer_id and signup_date. Remove merged cells, decorative headings, subtotals, and blank columns from the range. Every data row should have the same number of cells as the header. Our converter rejects mismatched widths instead of guessing where missing data belongs, which makes accidental pasted ranges easier to diagnose.

Convert values deliberately

The TSV tool keeps cells as strings. That preserves values such as 00123, false as a label, and dates whose format is ambiguous. Convert selected fields to numbers or booleans later using an explicit schema. An empty cell becomes an empty string; it is not automatically null or an omitted property. Choose that mapping according to the API or database contract.

Check the exported records

Inspect the first, middle, and final records and compare row counts. Test names with accents, quotes, tabs, and multiline addresses. If you reverse the conversion to TSV, nested objects are serialized as JSON text inside cells and missing or null fields become empty cells, so that direction does not preserve every JSON type. Keep the original JSON as the source of truth when types matter.

Worked example

EXAMPLE
customer_id	active
00123	false

[{"customer_id":"00123","active":"false"}]

Will this recreate numbers already rounded by Excel?

No. Export the original data again with identifier columns stored as text. Lost digits cannot be inferred reliably.

Reference and further reading

Read the official documentation ↗