# TSV to JSON: tab-separated parsing, quotes and pasted spreadsheet data

> How this converter reads tab-separated text (tab only, first row as header, CSV-style quoting honoured, everything a string), how that differs from the IANA text/tab-separated-values definition, and how ragged rows and blank lines behave.

- Tool: [TSV to JSON Converter](https://toolsg.com/en/tsv-to-json)
- Language: en (available: en, zh, ms, ta)
- Last verified against official sources: 2026-10-19
- Source site: ToolSG — a planning guide, not official or financial advice. Cite the agencies listed under Sources.

## Key figures at a glance

| Fact | Value | Source |
| --- | --- | --- |
| Delimiter | Tab only — Commas and spaces are ordinary characters; a literal backslash followed by t is not turned into a tab. | [IANA — text/tab-separated-values](https://www.iana.org/assignments/media-types/text/tab-separated-values) |
| Header row | Always the first row — Its cells become the JSON keys; there is no option to turn headers off. |  |
| Value types | Every value is a string — 30 becomes "30", 007 stays "007". |  |
| Quotes | A field that starts with " is read as quoted — Inside it, tabs and line breaks are kept and "" is one quote. The IANA registration defines no quoting. |  |

## What the converter does

Paste tab-separated text and the right-hand box shows a JSON array with one object per data row, indented with two spaces. It updates as you type, nothing is uploaded, and a Download link (`converted.json`) appears when there is output. This is the natural format for data copied out of a spreadsheet range, because spreadsheet programs typically put a tab between cells and a line break between rows; paste straight into the left box.

Example input (here `→` stands for a tab character):

```
name→city→age
Mei→Singapore→30
Ali→Johor→25
```

gives

```json
[
  { "name": "Mei", "city": "Singapore", "age": "30" },
  { "name": "Ali", "city": "Johor", "age": "25" }
]
```

Values are always strings: `"30"`, not `30`. Commas, spaces and semicolons mean nothing here, so `1, 2` stays `"1, 2"`.

## TSV in the standard versus this tool

The IANA registration for `text/tab-separated-values` is short. Each record is a single line, fields are separated by tabs, every record has the same number of fields, the first line names the fields, and "fields that contain tabs are not allowable in this encoding". It defines no quoting or escaping, so a strict reader cannot represent a tab or line break inside a value.

This tool is more generous. It uses the same quote handling as its CSV sibling (the convention of RFC 4180): a field whose first character is `"` is a quoted field in which tabs and line breaks are literal and `""` stands for one quote. So `"has<TAB>tab"` becomes the single value `has\ttab` and `"two<newline>lines"` a two-line value. That helps with files written by tools that quote, but it means a plain value that happens to start with a double quote is consumed as a quote, and a stray quote at the start of a field with no closing quote fails with "A quoted field was never closed — check for a stray double quote."

A double quote in the middle of a field is kept as text (`x"y` stays `x"y`). Spaces are never trimmed. Escape sequences are not decoded: the two characters `\` and `t` stay as they are.

## Rows, headers and blank lines

| Input | Result |
| --- | --- |
| row with fewer cells | missing cells become `""` |
| row with more cells than the header | extra cells are dropped silently |
| duplicate header names | the later column wins |
| empty header cell | key `column_N`, N being the position |
| blank line between rows | a record of empty strings |
| header row only | `[]` |
| CRLF, CR or LF line endings | all accepted; a single trailing newline is ignored |
| UTF-8 byte-order mark first | kept in the first key's name |

A row that is `x` followed by a tab (empty second cell) gives `{"a":"x","b":""}`, and a leading tab gives an empty first value. This matters when pasting from a spreadsheet: trailing empty cells are preserved as empty strings, not dropped.

> **Tip:** If spreadsheet cells contain line breaks, check how the source wrote them. When the text arrives quoted, as `"line1<newline>line2"`, this converter keeps the line break inside the value; unquoted line breaks start a new row.

## Common mistakes

- Pasting comma-separated data and getting one key: use [CSV to JSON](https://toolsg.com/en/csv-to-json).
- Pasting text where an editor or chat app converted tabs to spaces; there are then no tab delimiters left.
- Expecting numbers, booleans or `null`.
- Starting a value with a double quote (a measurement like `5"`) and getting a quote error or swallowed text.
- Expecting `\t` written as two characters to become a tab.

## Related tools

Convert back with [JSON to TSV](https://toolsg.com/en/json-to-tsv), read comma-separated files with [CSV to JSON](https://toolsg.com/en/csv-to-json), check the output with the [JSON validator](https://toolsg.com/en/json-validator), or browse it in the [JSON viewer](https://toolsg.com/en/json-viewer).

## Frequently asked questions

**Is my data uploaded anywhere?**

No. The conversion runs entirely in your browser using JavaScript. Nothing you paste leaves your device, is logged, or is stored on a server.

**How large a document can it handle?**

The limit is your browser's memory rather than any server quota. Documents of a few megabytes convert without trouble; very large files may make the page briefly unresponsive while it works.

**What happens to nested data?**

Formats that have no concept of nesting store nested values as a JSON string inside the cell, so nothing is silently discarded and the structure can be recovered.

**Does it handle quotes and commas inside fields?**

Yes. Parsing follows RFC 4180, so quoted fields containing commas, escaped double quotes, and line breaks inside a field are all read and written correctly.


## Sources

- [IANA — Media type text/tab-separated-values](https://www.iana.org/assignments/media-types/text/tab-separated-values) — Records are lines, fields are separated by tabs, the first line names the fields, and fields containing tabs are not allowable.
- [IETF — RFC 4180, Common Format and MIME Type for CSV Files](https://www.rfc-editor.org/rfc/rfc4180.html) — The quoting convention this tool applies to tab-separated text as well.
- [IETF — RFC 8259, The JSON Data Interchange Format](https://www.rfc-editor.org/rfc/rfc8259.html)
