JSON → types

Paste JSON and get ready TypeScript interfaces or Go structs. It merges object shapes across array items and marks fields optional when they are missing somewhere.

Paste JSON and get ready TypeScript interfaces or Go structs. It merges object shapes across array items and marks fields optional when they are missing somewhere.

How to use

  1. Paste a JSON object or array into the input
  2. Switch between TypeScript and Go output
  3. Nested objects become named interfaces/structs automatically
  4. Copy the generated types

Frequently asked questions

How are optional fields decided?

When an array holds objects and a key is absent in some of them, that field is marked optional (a? in TS, omitempty in Go).

What about mixed or null values?

Mixed primitives become a union (TS) or interface{} (Go); JSON null maps to null / interface{}.

Does it call any server?

No — parsing and type inference run entirely in your browser.