close
Skip to main content

JSON Schema to TypeScript

Paste a JSON Schema document (Draft 4 through 2020-12) and get TypeScript interfaces back. Handles $defs, $ref, allOf, anyOf, oneOf, enum, and string format annotations. Runs entirely in your browser.

What this converter handles

  • • All primitive types (string, number, integer, boolean, null)
  • enum → literal union
  • const → literal
  • $ref with #/$defs/X or #/definitions/X
  • anyOf, oneOf → union
  • allOf → intersection
  • array with items and prefix-items tuples
  • additionalProperties typed objects
  • • String format values map to branded string types

Privacy

The schema you paste is parsed by a tiny client-side script and never uploaded. Disconnect from the internet after the page loads and this tool still works.

For the inverse direction, see TypeScript → JSON Schema.

Related tools