JSON code generation / Kotlin
Free online JSON to Kotlin data class generator
Generate data classes for a profile with a nullable avatar. Open your JSON locally, then inspect and download the generated files.
Privacy-first processing: pasted or opened JSON stays in this browser tab and is not uploaded to our servers.
Recent successful runs
Only settings and opaque source fingerprints stay in this browser. JSON and results are not saved.
Loading local history...
Try the profile card example
The editor starts empty. Load this example only if you want a small source to test the generated model.
Static example with expected output
Verified with the local schema-codegen engine.
Profile JSON
{
"user_id": 42,
"display_name": "Mina",
"avatar": null,
"badges": [
"editor",
"mentor"
]
}Operation
Generate Kotlin data classes and enum candidates from repeated strings.
- Language: Kotlin
- Serializer: none
- Style: data class
- File layout: split files
Expected output excerpt (GeneratedRoot.kt)
data class GeneratedRoot(
val avatar: Any?,
val badges: List<GeneratedRootBadgesItemEnum>,
val display_name: String,
val user_id: Long
)Caveat: The avatar field is Any? because the sample has null and no non-null value to infer.
Before using this output
Nullability is sample-inferred, deserialization is separate, and separate files avoid the current single-file import-order limitation.
Generation analyzes the source shape; it does not validate every future input. Review the language, serializer, enum, primitive, and file-layout options before downloading.
Read the Kotlin workflow