Tree explorer will appear here once JSON is loaded
Select a node to inspect it
Tree explorer will appear here once JSON is loaded
Select a node to inspect it
Paste a sample JSON payload - an API response, a config file - and generate matching TypeScript interfaces automatically, instead of hand-writing types from a response you are staring at.
Arrays are sampled (the first 100 elements) and their object shapes are merged: a field present in every sampled element stays required, a field present in only some becomes optional with a ?, and a field whose type varies across samples (a string in one element, a number in another) becomes a union type. Nested objects get their own named interface, generated from the key that reaches them and converted to PascalCase, with a numeric suffix if two different nested shapes would otherwise collide on the same name.
The root of the document becomes interface Root; if the document's root is itself an array, you instead get a type Root = X[] alias pointing at the generated element interface.
Everything runs client-side against the JSON already loaded in the app - nothing is uploaded to our servers to generate the types.