Skip to content
ZeroServer.tools

JSON to Kotlin Data Class

Generate a Kotlin data class from a JSON sample — typed properties and nested class support.

data class Root(
    val id: Int,
    val name: String,
    val email: String,
    val score: Double,
    val active: Boolean,
    val tags: List<String>,
    val address: Address
)

data class Address(
    val street: String,
    val city: String
)

How JSON to Kotlin data class generation works

JSON types are mapped to Kotlin types: strings → String, integers → Int, decimals → Double, booleans → Boolean, arrays → List<T>, and nested objects → separate data class definitions. Nullable fields are marked with ?.

To add Kotlinx Serialization, annotate with @Serializable. For Java classes, try JSON to Java. For Swift structs, see JSON to Swift Struct.

Private & free — this tool runs entirely in your browser.

Recommended: IndieKit Ship your Next.js startup in days.affiliate

Related Converters tools