Instantly generate C# models and helper methods from JSON.

Generate C# classes with Json.NET attributes from JSON, JSON Schema, and GraphQL queries.

Run quicktype from the command line

Install it once with Homebrew or npm and generate C# from files, URLs, Postman collections, or stdin. It fits into an MSBuild target, 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 with brew
$ brew install quicktype$ brew install quicktype
Generate C# for a simple JSON sample$ echo '[1, 2, 3.14]' | quicktype --lang cs
$ echo '[1, 2, 3.14]' \    | quicktype --lang cs
Generate C# for a sample JSON file
$ quicktype person.json -o Person.cs$ quicktype person.json -o Person.cs
Generate C# from a directory of samples
$ ls spotify-api-samples$ ls spotify-api-samples
album.json artist.json track.json$ quicktype spotify-api-samples -o QTSpotifyClient.cs
$ quicktype -o SpotifyClient.cs \    spotify-api-samples
Generate C# models for a weather API$ quicktype https://goo.gl/Dq2yKd -o Weather.cs
$ quicktype -o Weather.cs \    https://goo.gl/Dq2yKd
Generate C# classes from TypeScript types
$ quicktype types.ts -o Types.cs$ quicktype types.ts -o Types.cs
Generate C# from a Postman Collection$ quicktype ImgurAPI_postman_collection.json -l postman -o Imgur.cs
$ quicktype -o Imgur.cs \    -l postman \    ImgurAPI_postman_collection.json

The Backwater · Charles W. Wyllie, 1903

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.

Generate C# nownpm install -g quicktype