JSON to Kotlin Data Class

Paste JSON and get Kotlin data classes with inferred types and nested classes.

Frequently asked questions

What does this generate?

Kotlin data classes matching your JSON — one per nested object, with val properties and inferred types (String, Long, Double, Boolean, List<...>).

Why Long and Double?

JSON numbers map most safely to Long for whole numbers and Double for decimals. Switch to Int/Float if your values are small and you prefer them.

Will it work with kotlinx.serialization or Gson?

Yes — it's a plain data class. Add @Serializable (kotlinx) or your Gson setup, and annotate fields with @SerialName/@SerializedName if your JSON keys differ from the property names.