Toolmanor

JSON to Kotlin data class

Paste a JSON sample to get Kotlin data classes: Int, Long and Double types, ? for nullable fields, = null for missing ones, optional kotlinx.serialization.

How to generate Kotlin data classes from JSON

  1. Paste a JSON sample on the left or open a .json file; the Kotlin code appears on the right.
  2. Turn on kotlinx.serialization if your project uses it, and rename the root type if you like.
  3. Copy it or download the .kt file.

Frequently asked questions

Related tools