fixtdoc

JSON to TypeScript

Paste a sample JSON value and get TypeScript interfaces that describe it: nested types, arrays, unions, and optional fields inferred from your data.

Files stay on your device

0 characters

TypeScript

Everything runs in your browser. Your text is not uploaded for processing and never leaves this device.

Frequently asked questions

How are nested objects handled?

Each distinct object shape becomes its own named interface, derived from the key it sits under, and identical shapes are deduplicated into one interface. Arrays of objects are merged across all items: a key that is missing from some items becomes optional.

What if a field has different types in different items?

The field gets a union type, for example string | number, so the generated types stay honest about the data you actually have.

Can I name the root type?

Yes. Set the root type name above the result; nested interface names are derived from it and from their keys.