· 4 min read
Turn a Spreadsheet Paste Into JSON
Manesh Jayawardhana
CIO & Co-founder
You select a block of cells in Google Sheets, copy it, and paste it somewhere — and what you get is tab-separated values, not the JSON array your test fixture or mock API response actually needs. It’s a small, specific annoyance: the data is right there, correctly organized, but in the wrong shape for the JavaScript file you’re editing.
Writing a script to reshape a one-off paste is overkill, and manually retyping ten rows into { "key": "value" } pairs is exactly the kind of tedious, error-prone work a script would avoid better than a human does. What you actually want is to paste once and get valid JSON back.
What converting TSV to JSON actually involves
TSV — tab-separated values — is what your clipboard holds after copying spreadsheet cells: rows separated by line breaks, columns separated by tab characters. Converting to JSON means treating the first row as field names (usually) and turning each following row into an object with those keys, or alternatively keeping each row as a plain array if there’s no header.
The tricky part is header detection and type guessing. A column of numbers pasted from a spreadsheet is still just text once it’s TSV — a good converter should recognize that “42” probably ought to be a number in the JSON output, not a quoted string, without misfiring on things like phone numbers or ZIP codes that look numeric but shouldn’t lose their leading zeros.
Why people get stuck here
- No header row. Sometimes the pasted data doesn’t have column names, and you want an array of arrays instead of an array of objects.
- Mixed types. Numbers, blanks, and text sitting in the same column confuse naive converters that guess a single type for the whole column.
- Copy-paste noise. Extra blank lines or a trailing tab character from the spreadsheet paste can silently break a strict parser.
- Writing a throwaway script for a one-time task. It works, but it’s a disproportionate amount of effort for pasting ten rows once.
What a good TSV-to-JSON converter looks like
Straightforward paste-and-convert
You paste the raw clipboard content, and the tool handles tab-splitting and row separation without extra configuration for the common case.
A choice between objects and arrays
Not every use case wants an array of named objects — sometimes a plain array of arrays is exactly what a downstream script expects.
Immediate, readable output
Formatted JSON you can copy straight into a file, rather than a minified blob you have to run through a formatter afterward.
Common mistakes to avoid
- Pasting data with a blank first row and getting garbage keys like
""for every field. - Assuming every column will convert to the “obviously correct” type — IDs and phone numbers that look numeric often need to stay strings.
- Forgetting that merged cells in the original spreadsheet don’t survive the copy — they paste as blank cells and can shift your column alignment.
- Not checking for trailing tabs or extra blank rows at the end of a spreadsheet selection before converting.
How to do it with TSV to JSON Converter
Online Tool Store’s TSV to JSON Converter processes the pasted text locally in your browser.
- Copy a range of cells from your spreadsheet.
- Paste it into the tool.
- Choose whether the first row is a header (producing objects) or plain data (producing arrays).
- Copy the resulting JSON into your code, config, or test fixture.
Because it runs in your browser, it works fine on data you’d rather not paste into a third-party API playground — internal reports, draft pricing tables, anything not meant for public tools.
Frequently asked questions
Does it work with data copied from Excel as well as Google Sheets?
Yes — both put tab-separated values on the clipboard when you copy a cell range, so the paste behaves the same way regardless of which spreadsheet app it came from.
What if my data doesn’t have a header row?
Choose the array-of-arrays output instead of array-of-objects — each row becomes its own array with no assumed field names.
Will numbers stay as numbers in the JSON?
Values that look like clean numbers are typically converted to JSON numbers rather than quoted strings, but double-check columns like ZIP codes or IDs where a leading zero or fixed length matters — you may want those kept as strings.
Final thought
For a one-time reshape of copied spreadsheet data, pasting into a converter beats writing a script you’ll use once and never touch again. Save the script-writing effort for jobs you’ll actually repeat.