JSON Schema to TypeScript

Input
Output

JSON Schema to TypeScript

Already have a JSON Schema? Paste it to get the types for your code: required properties stay required, the rest become optional, and every $ref and nested object becomes its own type.

How do I use the JSON Schema to TypeScript?

  1. Paste a JSON Schema (draft 4 to 2020-12).
  2. Pick the language: TypeScript, Zod, Go, Python, Pydantic, Java, C#, Rust and more.
  3. Copy or save the code.

What does the JSON Schema to TypeScript do?

  • $ref to $defs and definitions, including a schema that refers to itself
  • allOf merged into one type
  • type: ["string", "null"], nullable and anyOf with null as nullable
  • enum and const typed from their values
  • required decides what's optional
  • The same 25 languages as models from a sample

Frequently asked questions

Which drafts are supported?
Draft 4, 6 and 7, 2019-09 and 2020-12: properties, required, items, $ref inside the document, allOf, anyOf, oneOf, enum and const. References to other files aren't fetched.
Is my data uploaded?
No. Bracely runs entirely in your browser, so nothing you paste or open leaves your device.

More JSON tools

Bracely has more than 65 JSON tools in one page. Related ones:

Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut. About · Privacy policy
Last updated · Version 4.9 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram