Convert JSON, YAML, OpenAPI, or JSON Schema to Zod, TypeScript, Go, Rust, Prisma, and 160+ more formats.
Real type inference — detectsuuid,url,datetime, enums, andintvsfloatfrom your actual data.
Convert locally without signing in. Sign in to automatically save input and generated output to cloud history, unless you disable it in Settings.
Most JSON-to-schema converters output z.string() for everything. TypeMorph reads your actual values:
Input JSON TypeMorph output Other tools
───────────────────── ──────────────────────── ────────────────
"id": "a1b2-c3d4..." → z.uuid() z.string()
"email": "x@y.com" → z.email() z.string()
"site": "https://…" → z.url() z.string()
"ts": "2024-01-01T…" → z.iso.datetime() z.string()
"age": 25 → z.number().int().min(0) z.number()
"role": "admin" → z.enum(["admin","user"]) z.string()
- JSON / YAML / OpenAPI / JSON Schema → any output format
- TypeScript, Zod v4, Yup, Joi, Valibot — validation-ready schemas
- Go, Rust, Java, Python, Kotlin, Swift, C#, Dart, PHP — backend structs
- Prisma, Drizzle, Kysely, Mongoose, Sequelize, TypeORM — ORM schemas
- MySQL, Postgres, SQLite, DynamoDB, BigQuery, MongoDB — database schemas
- OpenAPI, GraphQL, Protobuf, JSON Schema — API specs
- MCP tool, OpenAI function calling, Vercel AI SDK tool — AI agent tool definitions
check— detect API schema drift from live responses, no OpenAPI spec neededenvdiff— compare staging vs production API schemas directlydiff— semantic breaking change detection between two schema filesvalidate— validate LLM/API JSON outputs against a Zod schema
- Schema Quality Score — A–F grading with field-level improvement suggestions
- VS Code Extension — convert schemas with
Ctrl+Shift+Twithout leaving your editor - CLI —
typemorph-clion npm for scripting and CI pipelines - Reverse — generate JSON samples from TypeScript interfaces
Web (no install): typemorph.dev
VS Code Extension:
ext install TypeMorph.typemorph-vscode
Open any .json, .yaml, or .ts file → Ctrl+Shift+T → pick your output format.
CLI:
npx typemorph-cli zod schema.json --root User
npx typemorph-cli typescript schema.json
npx typemorph-cli go schema.json > models.go
npx typemorph-cli mcp-tool schema.json --root SearchToolcurl -s https://api.example.com/users/1 | npx typemorph-cli zod --root UserPaste any API response and get a production-ready Zod schema with semantic validators.
# Save baseline on first run
curl -s https://api.example.com/users/1 \
| npx typemorph-cli check --baseline .typemorph/users.json
# Future runs compare against baseline — exits 1 on breaking changes
curl -s https://api.example.com/users/1 \
| npx typemorph-cli check --baseline .typemorph/users.jsonWorks with any JSON API, including third-party ones without OpenAPI specs.
npx typemorph-cli envdiff \
--a https://staging.api.com/users/1 \
--b https://prod.api.com/users/1# MCP tool definition
npx typemorph-cli mcp-tool schema.json --root SearchProducts
# OpenAI function calling
npx typemorph-cli openai-function schema.json --root GetOrder
# Vercel AI SDK
npx typemorph-cli vercel-ai-tool schema.json --root FetchUsernpx typemorph-cli prisma api-response.json --root User > schema.prisma
npx typemorph-cli drizzle api-response.json > schema.ts
npx typemorph-cli postgres api-response.json > migration.sqlConvert a shared JSON contract to Go structs, TypeScript interfaces, and Protobuf in one command:
npx typemorph-cli go contract.json > models.go
npx typemorph-cli typescript contract.json > types.ts
npx typemorph-cli proto contract.json > schema.protoname: API Schema Check
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check /users endpoint for schema drift
run: |
curl -s https://api.example.com/users/1 | \
npx typemorph-cli check \
--baseline .typemorph/users.json \
--format github >> $GITHUB_STEP_SUMMARYInstall: VS Code Marketplace
Ctrl+Shift+T— convert current file or selection to any format- Right-click → TypeMorph: Check Schema Quality
- Works with
.json,.yaml,.ts, OpenAPI specs
typemorph <format> [file] # convert to target format
typemorph quality [file] # schema quality score (A–F)
typemorph diff <old> <new> # breaking change detection
typemorph check --baseline <file> # API drift detection
typemorph envdiff --a <url> --b <url> # compare two live environments
typemorph validate <schema> <outputs> # validate LLM/API outputs
typemorph reverse [file.ts] # TypeScript → JSON sample
typemorph list # all supported formatsFull docs: npmjs.com/package/typemorph-cli
Input (JSON / YAML / OpenAPI / JSON Schema / TypeScript)
└─► inferSchema() → Schema AST → 160+ generators
└─► Zod, TypeScript, Go, Rust, Prisma, MCP, OpenAI …
All inference and code generation run in your browser (or Node.js for the CLI). Unsigned-in web conversions do not upload your input or output to cloud history. Signing in enables automatic history storage in Supabase by default; you can disable future saves in Settings → Privacy & Data Control. Previously saved data is not deleted by disabling saves or signing out.
Sharing is separate: small share links contain data in the URL fragment, while larger links upload compressed input and settings to Supabase when you click Share, even without signing in. URL import contacts the requested server; the optional proxy fetches it through Cloudflare. The website also uses Google Analytics, external editor assets, and optional feedback, authentication, and license services. See the Privacy Policy for details.
git clone https://github.com/yhan86818-creator/typemorph.git
cd typemorph
npm install
npm run dev # http://localhost:3000
npx vitest run # run tests
npm run build # static export → out/Next.js · Tailwind CSS v4 · Monaco Editor · Vitest · esbuild · Cloudflare Pages
MIT — see LICENSE.