PasteSheet icon PasteSheet logo mark — a spreadsheet grid with a curly brace on a green rounded square PasteSheet

Generate TypeScript types from a Google Sheet

Paste a Google Sheet URL and get a TypeScript interface describing a row — property names taken from your header row, property types inferred from the values underneath them.

The sheet must be shared with "Anyone with the link". Nothing is stored.

Key facts

  • Google's API requires a Google Cloud project plus OAuth credentials or a service account before it will return a single row. source
  • Google's Sheets API is cell-oriented: it reads ranges like A1:D50, not records. Reassembling those into row objects is work you do yourself. source
  • The Google Sheets API allows 300 read requests per minute per project and 60 per minute per user. Past that it returns 429 RESOURCE_EXHAUSTED. source
  • It needs no Google Cloud project, no OAuth consent screen and no service-account JSON. You paste a share URL, and MCP is included on the Free plan.

How to generate types from a Google Sheet

  1. 1 In Google Sheets, click Share, then set General access to Anyone with the link (Viewer is enough). If you skip this, the tool cannot read the sheet — check whether yours is public.
  2. 2 Copy the sheet URL from your browser's address bar. To use one specific tab, open that tab first so its gid ends up in the URL.
  3. 3 Paste it above. Each header becomes a property; each column's values are scanned to infer its type.
  4. 4 Copy the interface into your project.

What the output looks like

sheet.ts
export interface SheetRow {
  name: string;
  role: string;
  headcount: number;
  active: boolean;
  "Start Date": string;
}

How the types are inferred

The same column-type inference PasteSheet runs when you connect a sheet as an endpoint:

  • Every value in the column parses as a number → number.
  • Every value is a boolean-ish token (true/false, yes/no, 1/0) → boolean.
  • Every value parses as a date → string, because a date crossing JSON is a string, not a Date.
  • Anything else, or a mixed column → string.
  • A header that is not a valid TypeScript identifier is emitted as a quoted property — Start Date becomes "Start Date" rather than a syntax error. The header is never renamed for you, because the key you get back in the JSON is the header.

Types describe a shape — they do not fetch it

An interface tells your compiler what a row looks like. It does not get you the rows. For that you still need something to read the sheet at runtime, which is the part that normally means a Google Cloud project and a service account.

A PasteSheet endpoint gives you a plain JSON URL to fetch(), so the interface above and the data it describes come from the same place — and the endpoint watches the sheet's schema, so if someone renames a column the types you generated do not silently start lying. See the React guide.

What a live endpoint costs

Nothing, to start. The Free plan gives you 3 endpoints and 2,000 requests a month, with MCP included and no credit card. The tool above stays free and unlimited either way.

Free

For side projects and trying things out.

$0 /mo
Endpoints
3
Requests / mo
2,000
Row cap
500
  • MCP for AI agents

Frequently asked questions

Does my Google Sheet need to be public?

It needs to be readable by anyone with the link. In Google Sheets, click Share and set General access to "Anyone with the link". A sheet left as "Restricted" cannot be read by this tool, or by anything else that has not been explicitly granted access to it.

Can I use one specific tab?

Yes. Open the tab you want in Google Sheets and copy the URL from the address bar — it will contain a gid parameter identifying that tab. Paste that URL and the tool reads that tab rather than the first one.

Do you store my sheet or its data?

No. The rows are fetched, converted and handed back to you. The result is cached for about a minute so that a reload does not re-hit Google, and then it is gone. Nothing is written to a database and nothing is shared with anyone.

Why is a date column typed as string?

Because that is what you actually receive. JSON has no date type, so a date crosses the wire as a string and arrives in your code as a string. Typing it as Date would be a lie your compiler would happily believe until it crashed at runtime.

What happens to a column name with a space in it?

It is emitted as a quoted property — "Start Date": string — which is valid TypeScript and preserves the real key you will get back in the JSON. Silently rewriting it to startDate would produce an interface that quietly does not match the data.

Sources

Related tools

Turn your sheet into an API in minutes

Paste a Google Sheet URL and get a live REST API and MCP server — no backend, no code, free to start.