Type generation

JSON to Kotlin.

Generate idiomatic Kotlin data class definitions from any JSON document. Nullable fields are inferred, nested objects become their own classes, and nothing is uploaded.

Local · No upload · No size limit on opening · Apache-2.0

Pandia turns a JSON document into Kotlin data class declarations. Integer values map to Long, fields missing from some objects become nullable (?), and nested objects and arrays become their own named classes — ready to drop into a Kotlin or Android project.

Example

Input JSON:

{
  "id": 42,
  "name": "Ada",
  "active": true,
  "tags": ["admin", "early"]
}

Kotlin output:

data class Root(
    val id: Long,
    val name: String,
    val active: Boolean,
    val tags: List<String>
)

What you get

  • Idiomatic data class output with val properties.
  • Nullable (?) fields inferred from the document.
  • Nested objects and arrays become named classes and List<T>.
  • Deterministic output — pick the target, copy, paste.

It’s the same engine behind Pandia’s type generation — opinionated, deterministic, and built to run on files far too large for an online converter.

Frequently asked questions

How do I generate Kotlin data classes from JSON?

Open the Types panel in Pandia, choose Kotlin, and copy the generated data classes into your project.

Does it work with kotlinx.serialization, Moshi or Gson?

The output is plain Kotlin data classes, so it works with any of them — add your serializer’s annotations if you need them.

Does it run offline on large files?

Yes — the generator runs on your machine with nothing uploaded, and Pandia opens multi-gigabyte JSON without lag.

Get Pandia

Stop fighting your JSON.

Download the native app, open your biggest file, and get to work. Free, offline, and open source.