Output will appear here
Output will appear here
Convert JSON to Kotlin data classes instantly with our free JSON to Kotlin converter. The tool generates data classes with @SerialName annotations, nullable types, and proper Kotlin type inference for Android, Ktor, and server-side Kotlin projects. Skip the boilerplate and get type-safe models from any JSON payload.
Try Convert All - paste JSON once, see TypeScript, Go, YAML, and 15 more formats instantly.
Enter any JSON object or array in the input editor. The converter handles nested structures, arrays, and null values.
The output pane displays Kotlin data classes with val properties, @SerialName annotations, and proper Kotlin types including Int, Double, String, and List.
Copy or download the .kt file. The data classes are ready for use with kotlinx.serialization or Gson in your Android, Ktor, or Spring Boot project.
Yes. The output includes @SerialName annotations and is structured for kotlinx.serialization. You only need to add the @Serializable annotation to use them with Json.decodeFromString() in your project.
Fields with null values are typed with the Kotlin nullable suffix (e.g., String?). This leverages Kotlin null-safety so the compiler catches potential NullPointerExceptions at build time.
Yes. The generated data classes are standard Kotlin classes that Gson can deserialize. The @SerialName annotations are simply ignored by Gson, so no code changes are needed.
Numbers within the 32-bit integer range are typed as Int, while larger values are typed as Long. Decimal numbers are always typed as Double. This prevents overflow issues in Android and JVM applications.