Skip to content
Toolwright

JSON to TypeScript

JSON to TypeScript turns a JSON sample into ready-to-use TypeScript interfaces or type aliases. Nested objects become named interfaces, arrays are merged and keys missing from some items become optional. It runs in your browser.

Tool 060 · Developer
Outside requests …How to checkRuns on this deviceWorks offline once opened

How to use JSON to TypeScript

  1. Paste a sample of your JSON.
  2. Choose interfaces or type aliases and set the root name.
  3. Copy the TypeScript.

Frequently asked questions

How do I generate TypeScript types from JSON?

Paste a sample of the JSON, choose interfaces or type aliases and copy the result.

How does it handle arrays of objects?

The items are merged into one type. Keys that are missing from some items become optional.

Is my JSON uploaded?

No. The types are generated in your browser.

Next step

Need a schema instead of types? Generate a JSON Schema. Open JSON Schema Generator.

  1. 056

    JSON Formatter & Validator

  2. 061

    JSON to YAML Converter

  3. 118

    Text Diff Checker

  4. 058

    JSON Schema Generator