JSON input
Paste JSON, optionally name the root type, then generate.
Your Kotlin data class code will appear here.
Turn JSON into Kotlin data classes with val properties. Nullable types, default values, List fields, and nested classes are inferred for you.
Paste JSON, optionally name the root type, then generate.
Your Kotlin data class code will appear here.
Kotlin data classes compress a whole JSON object into one line of properties. The generator infers String, Int, Double, Boolean, List, and nested data classes, marking unreliable fields nullable with sensible defaults.
Whether you use kotlinx.serialization, Moshi, or Gson, the generated shape is what those libraries expect: a primary constructor with named properties and nullability that mirrors the real payload.