Jsontify

Ad-free, fast, private JSON viewer & editor

Paste JSON, drop a file, or Open

Explorer

Tree explorer will appear here once JSON is loaded

Inspector

Select a node to inspect it

Paste or open a file to begin
🔒 Processed in your browser - nothing is uploaded to our serversPrivacy

JSON to TypeScript Types

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.

Frequently asked questions

How does it handle arrays of objects with different fields?
It samples up to the first 100 elements and merges their shapes: a field in every sample stays required, a field in only some becomes optional, and conflicting scalar types become a union.
How are nested objects named?
Each nested object gets its own interface, named from the JSON key that reaches it (converted to PascalCase), with a numeric suffix if that name is already taken by a different shape.
What if the JSON root is an array instead of an object?
You get a type Root = ElementInterface[] alias instead of an interface named Root, since the root itself has no single object shape to name directly.
Is my JSON sample sent anywhere to generate the types?
No. Type generation runs entirely in your browser, against the document already loaded in the app - nothing is uploaded to our servers.