DevTulz Online

JSON β†’ TypeScript Types


What does this tool do?

This tool converts a JSON object or array into TypeScript interface or type declarations. It recursively handles nested objects (generating separate interfaces for each), arrays of objects (merging schemas), optional fields (when keys are missing from some array items), and null values. The output is ready to paste into your TypeScript project.

How to Use

  1. Paste your JSON into the left panel β€” the TypeScript types appear instantly on the right.

  2. Set the root interface name (default: Root).

  3. Choose interface or type alias style.

  4. Enable 'null β†’ optional' to treat null fields as optional unknowns instead of explicit null.

  5. Click Load example to see a sample conversion.

Arrays of objects are handled by merging all item schemas β€” keys present in only some items are automatically marked as optional. All conversion happens in your browser.

Keywords: JSON to TypeScript, JSON to TS, JSON to interface, TypeScript type generator, JSON type inference, TypeScript interface from JSON