NV ToolkitFormat · Validate · Convert

Code Generators

25 free tools · 100% client-side

Generate type-safe classes and models from JSON or XML for Java, Python, TypeScript, C#, Go, Rust, Kotlin, Swift, Dart, and Ruby.

Start here

Most-used Code Generators

All 25 Code Generators

JSON to Java

Paste a JSON or XML sample — the format is auto-detected — and get typed Java models with names, nesting and nullability inferred for you.

JSON to Python

Paste a JSON or XML sample — the format is auto-detected — and get typed Python models with names, nesting and nullability inferred for you.

JSON to Objective-C

Paste a JSON or XML sample — the format is auto-detected — and get typed Objective-C models with names, nesting and nullability inferred for you.

JSON to JSON Schema

Paste a JSON or XML sample — the format is auto-detected — and get typed JSON Schema models with names, nesting and nullability inferred for you.

JSON to Swift

Paste a JSON or XML sample — the format is auto-detected — and get typed Swift models with names, nesting and nullability inferred for you.

JSON to C#

Paste a JSON or XML sample — the format is auto-detected — and get typed C# models with names, nesting and nullability inferred for you.

JSON to Go

Paste a JSON or XML sample — the format is auto-detected — and get typed Go models with names, nesting and nullability inferred for you.

JSON to Rust

Paste a JSON or XML sample — the format is auto-detected — and get typed Rust models with names, nesting and nullability inferred for you.

JSON to Crystal

Paste a JSON or XML sample — the format is auto-detected — and get typed Crystal models with names, nesting and nullability inferred for you.

JSON to C++

Paste a JSON or XML sample — the format is auto-detected — and get typed C++ models with names, nesting and nullability inferred for you.

JSON to TypeScript

Paste a JSON or XML sample — the format is auto-detected — and get typed TypeScript models with names, nesting and nullability inferred for you.

JSON to JavaScript PropTypes

Paste a JSON or XML sample — the format is auto-detected — and get typed JavaScript PropTypes models with names, nesting and nullability inferred for you.

JSON to Kotlin

Paste a JSON or XML sample — the format is auto-detected — and get typed Kotlin models with names, nesting and nullability inferred for you.

JSON to Elm

Paste a JSON or XML sample — the format is auto-detected — and get typed Elm models with names, nesting and nullability inferred for you.

JSON to Ruby

Paste a JSON or XML sample — the format is auto-detected — and get typed Ruby models with names, nesting and nullability inferred for you.

JSON to Dart

Paste a JSON or XML sample — the format is auto-detected — and get typed Dart models with names, nesting and nullability inferred for you.

JSON to Pike

Paste a JSON or XML sample — the format is auto-detected — and get typed Pike models with names, nesting and nullability inferred for you.

JSON to Haskell

Paste a JSON or XML sample — the format is auto-detected — and get typed Haskell models with names, nesting and nullability inferred for you.

XML to Java

Paste an XML sample, get typed Java models — names, nesting and nullability inferred for you.

XML to Python

Paste an XML sample, get typed Python models — names, nesting and nullability inferred for you.

XML to C#

Paste an XML sample, get typed C# models — names, nesting and nullability inferred for you.

XML to Go

Paste an XML sample, get typed Go models — names, nesting and nullability inferred for you.

XML to TypeScript

Paste an XML sample, get typed TypeScript models — names, nesting and nullability inferred for you.

JSON to Zod

Paste a JSON sample, get a runtime-validating Zod schema plus its inferred TypeScript type — z.object, z.array and nested schemas built for you.

JSON to Pydantic

Paste a JSON sample, get clean Pydantic BaseModel classes — nested models named from your keys, Optional[...] where the sample had null, no positional-argument helper code to fight.

Learn more

From sample payload to typed models in seconds

Hand-writing model classes for an API response is the most mechanical work in programming: read a field, declare a property, guess the type, repeat for forty fields across six nested objects. These generators do it from a single pasted sample — names, nesting, arrays, optionality and types inferred — for nineteen target languages including Java, Python, TypeScript, C#, Go, Rust, Kotlin, Swift, and Dart, powered by quicktype, the same engine behind the most popular IDE plugins.

Both JSON and XML samples work as input (XML is parsed to a data model first, attributes included), and the output follows each language's idioms: data classes in Kotlin, structs with serde derives in Rust, dataclasses in Python, interfaces plus runtime converters in TypeScript. Generated code includes the serialization helpers, so the round trip from wire format to typed object ships with the models.

Getting the best output from one sample

Generation quality follows sample quality. Use a response where optional fields are present at least once, arrays contain at least one element, and numeric fields show their real range (a 1 could be an int; 1.5 settles it). If a field can be null, include a null occurrence so the generator marks it optional. Thirty seconds spent enriching the sample saves the manual type-fixing that generators are supposed to eliminate.

Which language family should I use?

The generator hub covers nineteen output languages, but they cluster into a handful of practical families. JVM shops reach for Java or Kotlin; .NET and Unity teams want C#; frontend engineers pull TypeScript interfaces, JavaScript PropTypes, or Flow types straight from an API response; Python and Ruby cover scripts, data pipelines, and Rails models; Go and Rust generate structs for high-performance services and CLIs; Swift, Objective-C, and C++ target native iOS, macOS, and embedded code; Dart feeds Flutter apps; and Elm, Crystal, Pike, and Haskell serve smaller, more particular ecosystems. A nineteenth option, JSON Schema, is not a programming language at all — it is a contract other tools validate against, and two more targets generate runtime VALIDATORS rather than plain types: JSON to Zod for TypeScript projects that want a schema and a type from one artifact, and JSON to Pydantic for Python projects (FastAPI especially) that want validation on construction rather than a plain class. Each family shares the same input step (paste a JSON or XML sample) and the same quicktype engine underneath, so switching target languages mid-project costs nothing but a dropdown click.

Generator families at a glance
ToolInputOutputBest for
Java & Kotlin generatorsJSON or XML sampleJava classes / Kotlin data classesBackend services on the JVM
C# generatorJSON or XML sampleC# classes, System.Text.Json-ready.NET backends and Unity projects
TypeScript, JavaScript & Flow generatorsJSON or XML sampleTS interfaces, JS PropTypes, or Flow typesFrontend apps consuming an API
Python & Ruby generatorsJSON or XML samplePython dataclasses / Ruby classesScripts, data pipelines, Rails backends
Go & Rust generatorsJSON or XML sampleGo structs / Rust structs with serde derivesHigh-performance services and CLIs
Swift, Objective-C & C++ generatorsJSON or XML sampleSwift Codable structs, Obj-C classes, or C++ structsiOS/macOS apps and native code
Dart generatorJSON or XML sampleDart classes with JSON serializationFlutter apps
Elm, Crystal, Pike & Haskell generatorsJSON or XML sampleIdiomatic types for each languageNiche or functional-language projects
JSON Schema generatorJSON or XML sampleA JSON Schema documentAPI contracts and payload validation
Zod & Pydantic generatorsJSON sampleZod schema + z.infer type / Pydantic BaseModel classesRuntime validation at the API boundary

Help

Frequently asked questions

Everything you need to know about the Code Generators.

01How accurate are the inferred types?

As accurate as the sample allows: types are inferred from the values present, unions from conflicting occurrences, and optionality from fields that appear in some objects but not others. The generator can't see fields your sample omits — feed it a representative payload and the output is production-ready scaffolding.

02Which languages are supported?

Nineteen targets: Java, Python, TypeScript, JavaScript (PropTypes), Flow, C#, Go, Rust, Kotlin, Swift, Objective-C, C++, Dart, Ruby, Elm, Crystal, Pike, Haskell, and JSON Schema — each with a dedicated page for JSON input and another for XML input — plus two runtime-validation targets, Zod and Pydantic, generated from a JSON sample.

03Is my API response uploaded to generate the code?

No — quicktype runs compiled to WebAssembly/JavaScript inside your browser. The sample, which often contains real customer data, never leaves your machine; generation works offline once the page has loaded.

Learn the format

Guides for code generators

All guides →