Convert JSON to TSV

Convert JSON to TSV with real tab/newline escaping. Nested flattening, header union, bidirectional. Free, offline, client-side.

Convert JSON arrays to Tab-Separated Values (or back). Real tab/newline escaping - values with embedded tabs or newlines won't corrupt the output. Header union by default - heterogeneous arrays don't lose columns. Nested objects flatten with dot-notation; arrays serialize as JSON, pipe-joined, first element, or skipped.

Enter input to convert.

How to Use Convert JSON to TSV

  1. Pick a mode - Encode (JSON → TSV) or Decode (TSV → JSON). Mode switch auto-re-runs if you have input loaded.
  2. Pick header strategy (encode) - Union picks every key seen in any row (the safe default for heterogeneous data; missing values become empty cells). First-row-only uses just the first row's keys (faster, but later rows can lose columns). Intersection keeps only keys present in every row.
  3. Pick nested object handling - Flatten with dot-notation produces extra columns (user.name, user.age). JSON-stringify puts the nested object as JSON into a single cell. Skip drops nested values entirely.
  4. Pick array handling - JSON-stringify produces [1,2,3]; pipe-join produces 1|2|3; first element keeps just 1; skip drops arrays.
  5. Pick escape mode - Backslash (t, n, \) is safer for any TSV consumer. Quote mode ("...") is closer to CSV convention and may be what Excel expects.
  6. Optional Excel-safe - wrap leading-zero numeric strings like 00123 with ="..." so Excel doesn't auto-convert to 123. Important for IDs and zip codes.
  7. Copy or download - Copy puts TSV on your clipboard for direct paste into Excel/Google Sheets. Download saves output.tsv. Decode mode saves output.json.

Frequently Asked Questions

Why does the escape mode matter?

Tabs and newlines inside cell values break TSV format if left raw – a tab adds an extra column, a newline starts a new row. Backslash mode replaces them with visible escape sequences (t, n). Quote mode wraps the whole field in "..." and lets the tab/newline survive (à la CSV). Either works; check what your consumer expects.

What does “Union header” do?

Walks every row, collects every key that appears anywhere, deduplicates while preserving first-appearance order. So [{"a":1},{"b":2}] → header row atb, data rows 1t and t2. Without union (first-row-only mode) the second row’s b would silently disappear from the header and the value of b would be lost.

How does the nested flatten work?

Each leaf in a nested object becomes a separate column: {"user":{"name":"A","age":30}} produces columns user.name and user.age. Arrays don’t flatten (they’d produce variable column counts) – pick one of the array handling modes for those instead.

What’s the Excel-safe leading-zero thing about?

If you paste 00123 into Excel, it auto-converts to 123 (losing the leading zeros). Common pain point for ID columns and zip codes. Excel-safe wraps such values with ="00123" which Excel respects literally. The downside: the cell looks like a formula in plain text editors. Turn off if you’re not pasting into Excel.

Will my data import cleanly into Google Sheets?

Yes – Google Sheets natively parses TSV on paste and from .tsv file open. Both backslash and quote escape modes work. Default settings (union header, dot-flatten nested, JSON-stringify arrays) produce clean spreadsheet rows.

How is TSV different from CSV?

TSV uses a tab as the column separator instead of a comma. Big advantages: tabs are rarely inside data (so quoting is often unnecessary), and Excel imports TSV more reliably than CSV. Big disadvantages: tabs can’t appear visibly in your text (so editing manually requires care), and some web forms strip tabs from clipboard input.

What happens when I decode TSV back to JSON?

The first row becomes the keys; subsequent rows become objects mapping keys → cell values. With “Coerce values” on (default), numeric-looking strings become numbers, "true"/"false" become booleans, "null" becomes null. Turn off if you need every value to stay a string.

Can I round-trip JSON → TSV → JSON exactly?

Mostly. Caveats: nested objects flattened to columns reassemble into flat objects (no nesting reconstruction); arrays stringified to JSON reparse correctly; pipe-joined arrays come back as a string (need post-processing). Set nested mode to “JSON-stringify” and array mode to “JSON-stringify” for the cleanest round-trip.

Is my data uploaded?

No. All escaping, flattening, parsing runs in your browser. Open DevTools → Network and watch zero requests fire after the page loads. Safe for sensitive data exports.

Does it work offline?

Yes. Total bundle is under 22 KB. Once loaded, disconnect and keep converting – handy for working with internal data dumps in air-gapped environments.