Graphite Text

JSON to TypeScript Type

Infer a TypeScript type from a JSON example, including nested objects, arrays and null values.

How to use

Paste valid JSON.

Enter a TypeScript type name.

Generate the type and review it against other samples before using it.

FAQ

How do I use this tool?

Paste valid JSON. Enter a TypeScript type name. Generate the type and review it against other samples before using it.

Can one sample reveal optional fields?

No. The result describes the provided sample. Optional properties, date strings and business constraints require review.

How are mixed arrays handled?

Different element shapes are combined as a union. Empty arrays become unknown[], and nesting beyond ten levels becomes unknown.

Are my inputs uploaded?

Tool inputs are processed in your browser. Advertising makes separate requests as described in the privacy policy.