TSV to JSON converter

TSV to JSON conversion splits each line on tab characters and uses the first line as property names.

Features

  • Spreadsheet friendlyCells copied from Excel or Google Sheets are already tab-separated.
  • Quotes are literalQuote characters are kept as ordinary text.
  • Runs on your deviceYour data is processed in the browser and is never uploaded.

How to use the TSV to JSON converter

  1. Copy cells including the header row.
  2. Paste them into the input.
  3. Copy or download the JSON.

TSV compared with CSV

Tabs rarely occur in real text, so TSV usually needs no quoting. That also means a value cannot itself contain a tab or newline.

Convert TSV to JSON in JavaScript

const [head, ...rows] = tsv.trim().split('\n').map((line) => line.split('\t'));
const json = rows.map((row) => Object.fromEntries(head.map((key, i) => [key, row[i]])));

Frequently asked questions

Can I paste straight from a spreadsheet?

Yes.

Why are my numbers strings?

Tick Convert numbers and booleans to type them.

Are empty cells kept?

Yes, as empty strings.

Related tools