Turn JSON into typesafe code in any language.

quicktype infers types from JSON, JSON Schema, and GraphQL, and generates models, serializers, and validators in more than 25 languages. Use it in the browser, from the command line, in your build, or hand it to your AI coding agent over MCP.

How it works

Three steps, in the browser, from the command line, or inside your agent.

  1. Start with data

    {
      "people": [
        { "name": "Atticus",
          "high score": 100 },
        { "name": "Cleo",
          "high score": 900 },
        { "name": "Orly" },
        { "name": "Jasper" }
      ]
    }

    Sample JSON, an API URL, a JSON Schema, or a GraphQL query: whatever you have.

  2. quicktype infers the types

    class MyData {
      people: Person[];
      
      static fromJson(json: string) {…}
    }
    
    class Person {
      name: string;
      highScore: int?;
    }

    You get models, serializers, and validators in your language, named and typed sensibly.

  3. Ship typesafe code

    let data = MyData.fromJson('{
      "people": [ { "name": "Olivia" } ]
    }')
    
    for person in data.people {
      print(person.name)
      person.highScore++
    }
    
    highScore may be undefined

    Your compiler, your IDE, and your AI agent can now all reason about the data.

What quicktype figures out

quicktype reads every sample you give it and infers the details that a hand-written type or a chatbot's guess would miss.

  • Enums hiding in plain string fields
  • Dates, times, and UUIDs encoded as strings
  • Integers vs. floats from the numbers it actually sees
  • Nullable vs. required properties, across every sample
  • Objects that are really maps with arbitrary keys
  • Equivalent structures unified into a single type
  • Heterogeneous values preserved as union types
  • Sensible names for every nested type

Run quicktype from the command line

Install it once with npm and generate code from files, URLs, or stdin. It fits into a Makefile, a CI job, or a git hook as easily as a one-off.

The Backwater, an oil painting by Charles William Wyllie of a woman on a riverbank watching a man in a punt
quicktype — zsh — 96×32
Install quicktype
$ npm install -g quicktype$ npm install -g quicktype
Turn a JSON file into TypeScript
$ quicktype user.json -o User.ts$ quicktype user.json -o User.ts
Or point it at a live API$ quicktype https://api.acme.dev/v1/orders -o Order.cs
$ quicktype -o Order.cs \    https://api.acme.dev/v1/orders
Pipe JSON in from anywhere$ curl -s https://api.acme.dev/v1/me | quicktype -l python -o user.py
$ curl -s https://api.acme.dev/v1/me \    | quicktype -l python -o user.py
Give it several samples for better types
$ ls samples/$ ls samples/
order-1.json order-2.json order-3.json
$ quicktype samples/ -o Order.swift$ quicktype samples/ -o Order.swift

The Backwater · Charles W. Wyllie, 1903

Give your AI agent a type system

quicktype lets agents understand JSON the way humans do: by inferring its shape and purpose. The more JSON you feed an LLM, the more confused it becomes. The more JSON you give quicktype, the better it understands it. Connect the quicktype MCP server and your agent stops guessing at data.

claudeOpus
Welcome to Claude Code
cwd: ~/acme/storefront
mcp: quicktype · connected
Ask Claude to work on a task…
Claude Max · Opus~/acme/storefront

Connect the MCP server

One hosted endpoint, no API key. Add it to Claude Code, Cursor, Codex, or any MCP client, and your agent gets quicktype's type inference as a tool.

quicktype MCP
Add quicktype to Claude Code$ claude mcp add --transport http quicktype \    https://mcp.quicktype.io/mcp
$ claude mcp add --transport http \    quicktype \    https://mcp.quicktype.io/mcp
Or point any MCP client at the server URLhttps://mcp.quicktype.io/mcp

A better way to work with data

Most teams still hand-write types, or let a chatbot eyeball a payload. Generated types are faster to get, and they stay correct.

The old way

Hunt for a client library
A good one is gold, but most are outdated, unmaintained, or simply don’t exist for your language.
Write the types by hand, or have a chatbot guess
Slow, error-prone, and stale the moment the API changes. An LLM eyeballing a payload misses optional fields, mislabels numbers, and invents structure that isn’t there.
Read the data as dynamic, untyped values
Every field access is a runtime gamble, and neither your compiler, your IDE, nor your AI assistant can help you.

With quicktype

Generate the client code
Give quicktype sample responses and get idiomatic, strongly typed models and serializers in your app’s language, in seconds.
Regenerate when the API changes
Run quicktype in your build or CI. When the API changes, regenerate and let the compiler point you at exactly what to update.
Give your tools something to work with
Typed data unlocks autocomplete, refactoring, and validation in your IDE, and gives AI agents an accurate model of your data instead of a guess.

Stop guessing at data.

Paste JSON and get typesafe code in seconds, in the browser, in your terminal, or inside your AI agent.