Turn JSON into typesafe code in any language.

quicktype's web app translates sample JSON to types and marshaling code

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.

Generate Code NowAdd to your AI agent
{
  "people": [
    { "name": "Atticus",
      "high score": 100 },
    { "name": "Cleo",
      "high score": 900 },
    { "name": "Orly" },
    { "name": "Jasper" }
  ]
}

Start with what you have: sample JSON,
API URLs, JSON Schema, or GraphQL queries.

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

class Person {
  name: string;
  highScore: int?;
}

quicktype infers the types and generates
models, serializers, and validators.

let data = MyData.fromJson('{
  "people": [ { "name": "Olivia" } ]
}')

for person in data.people {
  print(person.name)
  person.highScore++
}

highScore may be undefined

Ship code that your compiler, your IDE,
and your AI agent can all reason about.

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.

What quicktype figures out

  • 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
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
Install quicktype from npm
$ npm install -g quicktype$ npm install -g quicktype
Generate Go from a JSON sample on stdin$ echo '[1, 2, 3.14]' | quicktype --lang go
$ echo '[1, 2, 3.14]' \    | quicktype --lang go
Generate C# straight from a live API$ quicktype https://blockchain.info/latestblock -o LatestBlock.cs
$ quicktype -o LatestBlock.cs \    https://blockchain.info/latestblock
Generate TypeScript with runtime validation$ quicktype users.json -o User.ts --runtime-typecheck
$ quicktype users.json -o User.ts \    --runtime-typecheck
Generate Zod schemas from a JSON Schema$ quicktype -s schema pet.schema.json -o pet.ts -l typescript-zod
$ quicktype -s schema \    pet.schema.json -o pet.ts \    -l typescript-zod
Generate C# classes from TypeScript types
$ quicktype types.ts -o Types.cs$ quicktype types.ts -o Types.cs
Generate Swift from a directory of samples
$ ls spotify-api-samples$ ls spotify-api-samples
album.json artist.json track.json$ quicktype spotify-api-samples -o SpotifyClient.swift
$ quicktype -o SpotifyClient.swift \    spotify-api-samples

A better way to work with data.

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.