# bcherny/json-schema-to-typescript

Compile JSON Schema to TypeScript type declarations

Repository: https://github.com/bcherny/json-schema-to-typescript
Canonical: https://ross.abutalabs.com/products/json-schema-to-typescript
Homepage: https://bcherny.github.io/json-schema-to-typescript-browser/
Language: TypeScript
License: MIT
License Family: permissive
Topics: typescript, json-schema
Last push: 2026-08-22T07:46:32+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 3816, "days_push": 11, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3337, forks 464 (observed 2026-08-28T04:07:56.787847+00:00)

## What it is
A TypeScript library and CLI (json2ts) that compiles JSON Schema definitions into TypeScript type declarations. It can be used programmatically via compile/compileFromFile or from the command line, with a browser-based live demo also available.

## Use cases
- convert json schema to typescript interfaces
- generate typescript types from json schema files
- generate .d.ts declarations from api schemas
- batch convert a directory of json schemas to typescript
- generate typescript types from yaml schema files
- keep typescript types in sync with json schema

## When to choose
- you maintain JSON Schema definitions and want matching TypeScript typings
- you want both a CLI and a programmatic API for schema-to-types conversion
- you need glob-based batch conversion of schema files
- you want style customization like single quotes or no semicolons in generated types

## When to avoid
- you need to generate types from OpenAPI or GraphQL schemas rather than JSON Schema
- you need runtime validation, not just type declarations
- you work in a language other than TypeScript/JavaScript

## Facets
- artifact type: library
- maturity: active
- function: parser, cli, developer-tools, type-system
- domain: developer-tools, web-development, apis, programming-languages
- platform: cli, cross-platform
- tags: json-schema, typescript, code-generation, type-definitions, transpiler, json2ts, nodejs

## Member repositories
- bcherny/json-schema-to-typescript (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:56.787847+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:41:06.670960+00:00, confidence not recorded.
  - readme: https://github.com/bcherny/json-schema-to-typescript (fetched 2026-08-28T04:07:56.787847+00:00, sha f32209b1976e)
  - homepage: https://bcherny.github.io/json-schema-to-typescript-browser/ (fetched 2026-08-29T09:34:38.425177+00:00, sha 99d6c61299f0)
  - registry_npm: https://registry.npmjs.org/json-schema-to-typescript (fetched 2026-08-29T09:34:38.434625+00:00, sha 410ea3c45ae2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
