GeezerVison is showing quicktype.io — Turn JSON into typesafe code in any language.
Turn JSON into typesafe code in any language.
quicktype infers types from your JSON and generates models, serializers, and validators in more than 25 languages. Millions of developers have generated billions of lines of code with it, and more than 200 contributors have contributed to its open source project. Use it in the browser, from the command line, in your build pipeline, or hand it to your AI coding agent over MCP.
Nested objects become named types, named after the property they appear in, singularized and cased for the language: pull_requests becomes PullRequest. When two different shapes share a name, quicktype qualifies them by context: UserAddress and CompanyAddress.
class and default are Swift keywords, and model-year and top speed (mph) aren't identifiers anywhere. quicktype gives each property a legal, idiomatic name and generates the serializer, here CodingKeys, that maps it back to the original JSON key.
exportinterfaceUser {name: string;lastSeen: Date | null;avatar?: string;}
Give quicktype more than one sample and it merges what it learns. lastSeen appears in both but is sometimes null; avatar is missing from one, so it becomes optional. The more samples you provide, the more accurate the types.
Every qty quicktype saw was a whole number, but one price wasn't, so qty becomes an Int and price a Double. TypeScript only has number, so this one is shown in Swift.
publicpartialclassRecord{public Guid Id { get; set; }public DateTimeOffset CreatedAt { get; set; }public Uri Website { get; set; }}
In JSON these are all strings. quicktype recognizes the UUID, the ISO 8601 timestamp and the URL, and gives each the right type: Guid, DateTimeOffset and Uri. Swift gets UUID, Date and URL from the same sample; languages without such types keep the strings.
Ten tickets, but only three distinct priorities. quicktype notices that priority keeps repeating the same few strings and turns it into an enum. It waits for enough evidence first: a couple of samples never make an enum.
author and each element of coauthors have the same shape, so quicktype generates a single Author type and uses it in both places rather than two identical interfaces with different names.
exportinterfaceReading {sensor: string;value: boolean | number | string;}
value is a number in one reading, a string in another, and a boolean in a third. Instead of giving up and calling it any, quicktype keeps every possibility it saw as a union type.
items.json
[{"id":42},{"id":"a1b2c3"},{"id":7}]
→Item.java, ID.java
publicclassItem {private ID id;publicIDgetID() { return id; }publicvoidsetID(ID value) { this.id = value; }}publicclassID {public Long integerValue;public String stringValue;}
id is sometimes a number and sometimes a string. Java has no union types, so quicktype builds one: an ID class with a field per possibility, exactly one of which is non-null. The generated Jackson deserializer checks the JSON token and fills in the right field; the serializer writes back whichever is set.
Those keys don't look like property names; they look like data. quicktype scores every key against a Markov chain trained on real property names, and when they don't pass, the object becomes a map instead of a class with absurd properties.
user.json
{"login":"ada","followers":128}
→User.go
funcUnmarshalUser(data []byte) (User, error) {var r User err := json.Unmarshal(data, &r)return r, err}func(r *User) Marshal() ([]byte, error) {return json.Marshal(r)}type User struct { Login string`json:"login"` Followers int64`json:"followers"`}
Types alone don't read JSON, so quicktype also writes the code that does: here encoding/json struct tags and UnmarshalUser / Marshal helpers, with no dependencies at all. Where a language has no JSON support built in, quicktype leans on the lightest library it can and generates the rest itself.
repo.json
{"name":"quicktype","stars":13000}
→Repo.py
@dataclassclassRepo: name: str stars: int @staticmethoddeffrom_dict(obj: Any) -> 'Repo':assertisinstance(obj, dict) name = from_str(obj.get("name")) stars = from_int(obj.get("stars"))return Repo(name, stars)
Python, Ruby and JavaScript won't check types for you, so the generated code does it at the boundary: from_dict asserts that the input is an object, and the generated from_str and from_int helpers assert each field's type. Bad data fails where it enters, not somewhere deep in your program.
Or point any MCP client at the server URLhttps://mcp.quicktype.io/mcp
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.
Add your lines to the ten billion.
Paste JSON and get perfect typesafe code in seconds, in the browser, in your terminal, or inside your AI agent.
You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.