JSON to Kotlin Data Class
Generate a Kotlin Data Class from a JSON sample in your browser. Infer nested fields and download the complete source file.
json-to-kotlinLOCAL WORKSPACE
Input and files stay in your browser. UTF-8 limit: 256 KiB.
Uses kotlinx.serialization + Kotlin serialization compiler plugin.
How to use this tool
Paste or open a local UTF-8 JSON sample, name the root type, and choose the available options. Convert, then copy or download the complete declarations.
When not to use it
Types reflect the sample. Empty arrays and shapes your target language cannot express directly can use a general JSON value. Some serializers treat missing and null fields alike. Review the generated model and configure the named serialization library in your project.