Search tools

Search for a command to run...

JSON to TypeScript / Go Types

Generate TypeScript interfaces or Go structs from sample JSON — nested objects, arrays and optional fields inferred automatically.

How to use

  1. 1Paste a sample JSON response.
  2. 2Pick TypeScript or Go and a root name, then copy the generated types.

Frequently asked questions

How are optional fields detected?

When an array contains several objects, any key missing from some of them is marked optional (?: in TypeScript, omitempty in Go).

What happens with null values?

A value that's always null is typed null (interface{} in Go). If it's sometimes a string, you get string | null or *string.

How accurate are the types?

They match the sample you provide. Include a representative response — edge cases missing from the sample won't be in the types.