Can I copy cells from Google Sheets or Excel and paste them straight in to get JSON?

Yes. Cells copied from a spreadsheet paste as text with tab characters between the columns. With the delimiter left on 'Auto-detect', the tool recognises the tab and turns the first row into keys. Arabic stays as it is, and values remain strings unless you switch on number conversion.

Published · 3 min read

Why pasting works without an export

Spreadsheet programs put a text version of the selected cells on the clipboard, with columns separated by tabs and rows by line breaks. That is exactly a TSV file, which is CSV with tabs instead of commas. So there is no need to download as CSV and then open the file; select, copy and paste is enough.

Example: three columns from a product sheet

In a product sheet we selected three header cells, sku, name and price, and one row beneath them: A1, قهوة (coffee) and 45. Pasted, the text looked like this, where the wide gaps are tab characters:

sku name price A1 قهوة 45

The tool turned it into one object and reported 'Delimiter used: Tab' under the output:

{"sku": "A1", "name": "قهوة", "price": "45"}

The Arabic word arrived intact, because pasted text skips the encoding trouble that affects some older Excel files. The price 45 stayed a string in quotes. With 'Convert numbers and true/false to JSON values' ticked, price became the number 45 with no quotes.

Steps

  1. In Google Sheets or Excel, select the cells including the header row, and copy them.
  2. Open the CSV and JSON converter and choose 'CSV to JSON'.
  3. Paste into the 'CSV text' box and leave the delimiter on 'Auto-detect'.
  4. Check the line 'Delimiter used: Tab' and the row and column counts.
  5. Tick number conversion if every numeric column holds amounts or quantities, then copy the JSON.

Things to watch when copying from a sheet

  • Copy the header row with the data. Leave it out and your first product becomes the key names.
  • You copy values as they are displayed. If the price column is formatted to show '45.00 SAR', that text is what arrives, not the number stored behind the formatting.
  • Do not switch on number conversion if the sheet has phone numbers or product codes starting with zero, because it strips leading zeros.
  • Hidden columns can be copied along with the selection in some programs, so check the key names in the output.

When exporting a file is still better

Copy and paste suits tens or hundreds of rows. For very large sheets, opening a file can be easier than pasting a long block of text, and the tool accepts text or files up to 5 MB. If the JSON will be reviewed before use, you can format and inspect it in the JSON formatter and validator.

Common questions

Do I need to choose Tab myself?

Usually not; auto-detect recognises it. If a message says the delimiter could not be detected, pick Tab yourself.

Is the pasted data stored anywhere?

No. The conversion runs in your browser and the data is not sent to a server.

Does pasting from Numbers or LibreOffice work?

Common spreadsheet programs usually copy cells as tab-separated text, but try it and check the 'Delimiter used' line.