JSON to Kotlin Data Class — Free Online
JSON to Kotlin data class generator — emits @Serializable classes with @SerialName annotations for kotlinx.serialization. Built for Android workflows.
Generate Kotlin data classes from any JSON sample — one class per unique object shape, @SerialNameannotations preserving original keys, sensible type inference (Long, Double, Boolean, List<T>). Built for Android workflows with kotlinx.serialization.
Working on iOS too? JSON to Swift Codable. Server-side Java? JSON to Java POJO.
How to Generate Kotlin Data Classes from JSON
Paste a JSON sample
An API response, a Firebase payload, or any JSON that represents the shape you want to model in Kotlin.
Click Convert to Kotlin
PDFFlare emits one data class per unique object shape with @SerialName annotations preserving the original keys.
Drop into your Android project
Paste the data classes into your .kt files. With kotlinx.serialization on the module, parsing JSON is a single Json.decodeFromString call.
When Do You Need JSON to Kotlin?
Android API integrations: You hit a REST endpoint with Retrofit or Ktor; you need a data class to map the response into. Generate it from a real payload instead of hand-typing nested fields.
Firebase / Firestore: Document data is JSON-shaped. Generate the data class once, annotate it for Firestore deserialization, and you have typed snapshots.
Multiplatform projects: Kotlin Multiplatform shares model classes between Android, iOS, and JS targets. Generate once from a JSON sample; reuse everywhere.
Migrating Java to Kotlin: Don't hand-port the POJOs — paste the JSON sample, generate fresh Kotlin data classes, and drop them into the converted file tree.
Why Use PDFFlare for JSON to Kotlin?
kotlinx.serialization Ready
@SerialName annotations preserve original keys, @Serializable classes work with Json.decodeFromString out of the box.
Idiomatic Data Classes
Immutable val properties, camelCase identifiers, Kotlin reserved words escaped with backticks where needed.
100% Browser-Based
JSON samples stay on your device — safe for production payloads.
No Signup Required
No account, no rate limits.