Paste any JSON and get ready-to-use Kotlin types in one click. Nested objects, arrays, optional fields and awkward key names are handled for you, and everything runs in your browser, so API responses and sample payloads are never uploaded.
Root.JSON input
{
"id": 1,
"name": "Alice",
"active": true,
"score": 98.5,
"tags": ["admin"],
"address": { "city": "New York" }
}Kotlin output
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class Root(
val id: Long,
val name: String,
val active: Boolean,
val score: Double,
val tags: List<String>,
val address: Address
)
@Serializable
data class Address(
val city: String
)| JSON | Kotlin |
|---|---|
| string | String |
| whole number | Long |
| decimal number | Double |
| boolean | Boolean |
| array | List<T> |
| object | a data class |
| null / unknown | Any |
Properties are camelCase. Classes are annotated @Serializable for kotlinx.serialization, and keys that differ from the property name get @SerialName("key").
val root = Json.decodeFromString<Root>(jsonString)Describe the same data with the JSON Schema generator, get TypeScript interfaces, create a SQL table, fix broken input with JSON Repair, or compare payloads with JSON Diff.
Paste your JSON and copy the output. Objects become @Serializable data classes, arrays become List<T>, whole numbers become Long and decimals become Double.
kotlinx.serialization. Keys that are not valid Kotlin property names get @SerialName("original-key"). If you use Gson or Moshi, replace @SerialName with @SerializedName or @Json(name = ...).
Fields that are null or absent in some array items become nullable types with a default of null (val note: String? = null), so decoding does not fail when the key is missing. Everything runs in your browser — your JSON is never uploaded to a server.