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
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to CSV
Flatten a JSON array of objects into CSV rows.
CSV to JSON
Parse CSV with headers into a JSON array of objects.
JSON to XML
Convert JSON structures into nested XML markup.
JSON Minifier
Strip whitespace to produce compact JSON.
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.