{}TS

JSON to TypeScript

Paste a JSON response and get TypeScript interfaces for it. Optional fields are detected.

How it works

Writes TypeScript interfaces from a sample JSON response. Keys missing from some items become optional.

Good to know

Common questions

Why is a field typed as null?
The sample had null, so the true type is unknown. Edit it.
Can I name the root type?
Yes, and you can choose interface or type.
Is it uploaded?
No. Everything runs in your browser and nothing leaves your device.

More in Developer.