Azlaan Electric AC Solar Center — Solar, CCTV, AC & electrical work, Faisalabad Call: 0300-8987448

JSON to TypeScript

Paste any JSON and get ready-to-use TypeScript interfaces in seconds. Nested objects get their own interfaces, array items are type-inferred and merged, and you control the root name, optional fields and the export keyword. Everything runs in your browser — your data never leaves this page.

How to use

  1. Paste or type your JSON into the input box (or press Load Sample to try it).
  2. Set the root interface name and choose whether fields are optional and exported.
  3. Press Generate TypeScript to see the interfaces.
  4. Use Copy to copy the result, or Download .ts to save it as a file.

Good to know

  • Nested objects each get their own interface, named from their property path.
  • Arrays of objects are merged: every item shape is combined into one inferred interface.
  • A field missing from some array items is always marked optional, even with the toggle off.
  • Empty arrays become any[] and mixed-type fields become union types.
  • Invalid JSON shows a clear error with the exact position of the problem.