JSON to Kotlin Converter
Generate Kotlin data classes from JSON. Paste your JSON:
Loading...
Loading...
Generate Kotlin Data Classes
This tool converts JSON to Kotlin data classes with support for popular serialization libraries: kotlinx.serialization, Moshi, and Gson.
Example Output
@Serializable
data class User(
val id: Int,
@SerialName("user_name") val userName: String,
val email: String,
@SerialName("is_active") val isActive: Boolean
)Serialization Options
| Library | Annotation | Best For |
|---|---|---|
| kotlinx.serialization | @Serializable | Kotlin Multiplatform, modern projects |
| Moshi | @Json | Android, Square ecosystem |
| Gson | @SerializedName | Legacy Android projects |
Type Mapping
| JSON | Kotlin |
|---|---|
| string | String |
| integer | Int / Long |
| decimal | Double |
| boolean | Boolean |
| null | String? |
| array | List<T> |
| object | Nested data class |
Related Tools
- JSON to Java — Generate Java POJOs
- JSON to Swift — Generate Swift structs
- JSON to TypeScript — Generate TS interfaces
- JSON Validator — Validate JSON first