JSON to Kotlin

Convert JSON data to Kotlin data class definitions for quick Kotlin data class code generation.

How to Use

  1. Paste or type JSON data into the left input box.
  2. Optionally specify the generated Kotlin data class name in the class name input box (default is RootObject).
  3. Click the "Convert to Kotlin" button. The converted Kotlin data class code appears on the right.
  4. Click "Copy Result" to quickly copy the converted Kotlin code.

Related Tools

About JSON to Kotlin

JSON to Kotlin is a free online code generation tool that helps you quickly convert JSON data to Kotlin data class definitions. In Kotlin and Android development, we often need to define corresponding data classes (data class) based on API-returned JSON data, which is time-consuming and error-prone when done manually.

Simply paste JSON data and the tool will automatically analyze the JSON structure and generate the corresponding Kotlin data class, including nullable types, nested data classes, and list types. Supports conversion of all JSON types including strings, numbers, booleans, arrays, and nested objects. You can customize the generated class name for direct use in your projects. The entire operation runs locally in the browser without uploading data to any server.