Tools · TSV

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.

no signup · runs entirely in your browser · ⌘V works anywhere on this page
See it done · 10 s
A spreadsheet paste to JSONCells copied out of a spreadsheet are TSV; they open as rows with the header found, and Convert, JSON writes an array of objects. · 10 s

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.

catalogue-paste.tsv
sku	title	qty	unit_price	tax_rate
BRD-OAK-002	Oak End Grain Cutting Board	1	124.00	0.0875
OIL-MNRL-008	Food Safe Mineral Oil 8oz	2	12.50	0.0875
KNF-CHF-201	Chef Knife 8in	1	89.00	0.0875
BRD-WAL-114	Walnut Serving Board	3	64.00	0.0875
SPN-SET-003	Spoon Set	1	28.00	0.0875

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.

unstringify for VS Code14-day trial · Free and Pro

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.

Try it on the file that broke your afternoon.

free while in alpha · no signup