JSON to Kotlin Converter

Generate Kotlin data classes and Jackson mappings from JSON, with nested models, nullable fields and a downloadable source file.

How to generate Kotlin models

Paste a representative JSON object or array, choose a root type name and run the generator. Use the file selector to inspect each source file; Copy copies only the selected file. Download ZIP keeps all generated files together. Original JSON field names are mapped in complete output even when they are language keywords or contain punctuation.

Complete output uses Jackson 2.x (2.12 or later) with the Kotlin module; install matching jackson-databind and jackson-module-kotlin dependencies. Keep the quicktype package or update it consistently. Models-only data classes omit JSON mappings, so renamed fields require your own serialization configuration. The generated Jackson mapper omits null properties when serializing.

Samples, optional fields and limits

For several responses of the same shape, select JSON Lines and put one JSON document on each line. Fields missing from some object samples become optional; an explicit null contributes a nullable type. Empty arrays and null-only fields do not contain enough evidence to infer a precise element or value type. Add representative samples and review the generated model.

String values stay strings, including numeric IDs, dates and UUIDs. This infers a model from examples, not a full API contract. Limits: 200,000 characters, 64 nesting levels, 50 sample documents, 50 generated files and 1,000,000 output characters. Processing runs locally in a cancellable worker with a 10-second deadline.

Questions & answers

Are missing fields the same as null?

No. Missing fields indicate optional membership; null is a value. The target language may represent both through an optional or nullable type. Provide multiple samples and use All fields optional only when that matches your application.

Does this fetch schemas or send JSON to an API?

No. Only the JSON samples you enter are used. No schema URLs or JSON strings are fetched, and the generated program is not executed on this page.

Other Languages