HomePostsProjectsTagsAbout
Kiran Johns

Product manager who codes. Writing about tech and life.

Navigate

AboutPostsProjects

Links

Tags
Back to Sheet to JSON

Documentation

Contents

  • Getting Started
  • Output Formats
  • Nested JSON
  • Type Inference
  • Examples
  • Tips
  • FAQ

Getting Started

  1. Open any Google Sheet
  2. Go to Extensions → Sheet to JSON → Open Converter
  3. The sidebar will appear on the right

Output Formats

Array of Objects

Converts each row into a JSON object using the first row as keys.

Spreadsheet:

nameagecity
John30NYC
Jane25LA

Output:

[
  { "name": "John", "age": 30, "city": "NYC" },
  { "name": "Jane", "age": 25, "city": "LA" }
]

Array of Arrays

Converts the sheet into a raw 2D array, including headers.

Output:

[
  ["name", "age", "city"],
  ["John", 30, "NYC"],
  ["Jane", 25, "LA"]
]

Nested JSON

Create nested objects and arrays using special header notation.

Dot Notation (Nested Objects)

Use . to create nested objects.

Spreadsheet:

nameaddress.streetaddress.cityaddress.zip
John123 Main StNYC10001

Output:

[
  {
    "name": "John",
    "address": {
      "street": "123 Main St",
      "city": "NYC",
      "zip": 10001
    }
  }
]

Deep Nesting

Chain multiple dots for deeper nesting.

Spreadsheet:

nameaddress.geo.lataddress.geo.lng
Office40.7128-74.0060

Output:

[
  {
    "name": "Office",
    "address": {
      "geo": {
        "lat": 40.7128,
        "lng": -74.006
      }
    }
  }
]

Bracket Notation (Arrays)

Use [0], [1], etc. to create arrays.

Spreadsheet:

nametags[0]tags[1]tags[2]
Johndeveloperdesignerwriter

Output:

[
  {
    "name": "John",
    "tags": ["developer", "designer", "writer"]
  }
]

Arrays of Objects

Combine brackets and dots for arrays of objects.

Spreadsheet:

nameitems[0].productitems[0].priceitems[1].productitems[1].price
Order1Apple1.50Banana0.75

Output:

[
  {
    "name": "Order1",
    "items": [
      { "product": "Apple", "price": 1.5 },
      { "product": "Banana", "price": 0.75 }
    ]
  }
]

Type Inference

When enabled, automatically converts string values to appropriate types.

Cell ValueConverted ToType
123123number
45.6745.67number
-89-89number
truetrueboolean
falsefalseboolean
TRUEtrueboolean
2024-01-15"2024-01-15T00:00:00.000Z"ISO date string
(empty cell)nullnull
Hello"Hello"string

Type Inference ON:

{ "count": 42, "active": true, "name": "John" }

Type Inference OFF:

{ "count": "42", "active": "true", "name": "John" }

Examples

Simple Contact List

Spreadsheet:

nameemailphone
John Doejohn@example.com555-1234
Jane Smithjane@example.com555-5678

Output:

[
  {
    "name": "John Doe",
    "email": "john@example.com",
    "phone": "555-1234"
  },
  {
    "name": "Jane Smith",
    "email": "jane@example.com",
    "phone": "555-5678"
  }
]

Product Catalog

Spreadsheet:

idnamepricecategory.maincategory.subinStock
1Laptop999.99ElectronicsComputerstrue
2Desk249.50FurnitureOfficefalse

Output:

[
  {
    "id": 1,
    "name": "Laptop",
    "price": 999.99,
    "category": {
      "main": "Electronics",
      "sub": "Computers"
    },
    "inStock": true
  },
  {
    "id": 2,
    "name": "Desk",
    "price": 249.5,
    "category": {
      "main": "Furniture",
      "sub": "Office"
    },
    "inStock": false
  }
]

User with Multiple Addresses

Spreadsheet:

usernameaddresses[0].typeaddresses[0].cityaddresses[1].typeaddresses[1].city
john123homeNew YorkworkBoston

Output:

[
  {
    "username": "john123",
    "addresses": [
      { "type": "home", "city": "New York" },
      { "type": "work", "city": "Boston" }
    ]
  }
]

Tips

  1. Header names become JSON keys - Keep them simple, no spaces recommended
  2. Empty cells become null - When type inference is enabled
  3. First row is always headers - In Array of Objects mode
  4. Preview first - Always preview before downloading to verify structure
  5. Array indices start at 0 - Use [0], [1], [2], etc.

FAQ

Q: What's the maximum sheet size?

No hard limit. Processing happens in your browser, so very large sheets may take a few seconds.

Q: Can I export multiple sheets?

Currently exports the active sheet only. Switch sheets and export separately.

Q: Why are my numbers showing as strings?

Make sure "Infer data types" is checked before generating preview.

Q: How do I create an empty array?

Leave all array index cells empty - they will be omitted from output.

Sheet to JSON·by Kiran Johns
PrivacyTermsSupport