Free online converter · A SkilledHat solution

JSON to Kotlin Data Class Generator

Convert JSON to Kotlin data classes online. Generate Gson annotations or plain Kotlin models, then preview, copy, or download the code.

Your JSON is processed only to create the downloadable model files. See our privacy policy.

JSON to Kotlin models

From API response to typed data classes

Skip repetitive property definitions and start using your API response in Kotlin.

Gson-ready mapping

Generate nullable Kotlin properties with SerializedName annotations that preserve the original JSON keys.

Plain Kotlin classes

Choose dependency-free Kotlin data classes when your project does not need Gson annotations.

Nested models handled

Generate typed classes for nested objects and arrays, including safe Kotlin identifiers for unusual JSON keys.

FAQ

JSON to Kotlin questions

How do I convert JSON to a Kotlin data class?

Paste a representative JSON object, choose Gson or plain Kotlin, set the root model name, and generate the data classes. You can preview, copy, or download the result.

Does Json2Kotlin generate Kotlin POJO-style models?

Yes. In Kotlin, data classes are the usual equivalent of Java POJOs. Json2Kotlin generates typed data classes from the JSON structure.

What is the difference between Gson and plain Kotlin output?

Gson output includes SerializedName annotations so Kotlin property names can safely differ from JSON keys. Plain Kotlin output has no Gson dependency.

Can Json2Kotlin convert Kotlin code back to JSON?

No. Json2Kotlin currently converts sample JSON into Kotlin data classes; it does not parse Kotlin source code into JSON.