Gson-ready mapping
Generate nullable Kotlin properties with SerializedName annotations that preserve the original JSON keys.
Convert JSON to Kotlin data classes online. Generate Gson annotations or plain Kotlin models, then preview, copy, or download the code.
Skip repetitive property definitions and start using your API response in Kotlin.
Generate nullable Kotlin properties with SerializedName annotations that preserve the original JSON keys.
Choose dependency-free Kotlin data classes when your project does not need Gson annotations.
Generate typed classes for nested objects and arrays, including safe Kotlin identifiers for unusual JSON keys.
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.
Yes. In Kotlin, data classes are the usual equivalent of Java POJOs. Json2Kotlin generates typed data classes from the JSON structure.
Gson output includes SerializedName annotations so Kotlin property names can safely differ from JSON keys. Plain Kotlin output has no Gson dependency.
No. Json2Kotlin currently converts sample JSON into Kotlin data classes; it does not parse Kotlin source code into JSON.