TSV to JSON
Cells copied out of a spreadsheet arrive with tabs between them — TSV, whether you knew the name or not. The header is found, and each row becomes an object.
What you get
- Reads the pasted cells as 5 rows under their header and writes 5 objects, one per row
- Finds the header row from the text — and says so, before anything is written
- Keeps a number a number and a text a text; an empty cell is an empty string
- Reads a paste without a header row too — the columns are numbered c1, c2 … and the app lets you name them
- Converts the same rows to NDJSON, a Markdown table, YAML or XML from the app
What it will not do
- Open .xlsx. Copy the cells and paste them — the clipboard writes TSV.
- Coerce a value it is not sure of. A number written with a comma is a question with a preview, not a guess.
- Send your text anywhere. The page is static and the engine runs in this tab — open the network panel and watch it stay empty.
What a spreadsheet paste is
- Cells with tabs between → objects
sku qty A 1[ { "sku": "A", "qty": 1 } ]- The header row
Detected from the text: a first row of names over rows of values is the header; without one the keys are c1, c2 …
- A number stays a number
price qty 12.50 3[ { "price": 12.5, "qty": 3 } ]- An empty cell
Becomes an empty string, never a guess.
The sample
What the first sample opens — a real file, not an illustration written for this page.
in VS Code
A .tsv file is a language the extension contributes; Read as records, then Convert, then JSON writes the array into a new editor.
Questions
Why does a spreadsheet copy work here?
Excel, Numbers and Google Sheets put the copied cells on the clipboard as tab-separated text. Pasted here, that text is TSV and reads as rows.
What if my first row is data, not a header?
The reading question shows the guess with a preview; switch it to data and the keys become c1, c2 and so on.
Do numbers stay numbers?
Yes — 12.50 becomes 12.5 in the JSON, 3 stays 3, and a text that only looks numeric stays text when the column is mixed.