JSON to Kotlin Data Class

Generate Kotlin data classes from any JSON payload.

Support
Works Offline
Privacy First
No Login
No API

JSON input

Kotlin data classes

Kotlin
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class Root(
    val id: Int,
    val name: String,
    val active: Boolean,
    val score: Double,
    val tags: List<String>,
    val address: Address,
    val nickname: Any? = null
)

@Serializable
data class Address(
    val city: String,
    val zip: String
)

About the JSON to Kotlin Data Class

Paste a JSON object or array and get idiomatic Kotlin data classes, including nested classes for embedded objects, List<T> for arrays, nullable types for nulls, optional kotlinx.serialization annotations with @SerialName for non-camelCase keys, and default null values.

Examples

Simple object

JSON{"id":1,"name":"Ada"}

Output

data class Root(
    val id: Int,
    val name: String
)

Keyboard shortcuts

  • Copy the main outputCtrl / ⌘ + Shift + C
  • Download the resultCtrl / ⌘ + S
  • Share this toolCtrl / ⌘ + Shift + S
  • Reset the inputsAlt + R
  • Open the tool search paletteCtrl / ⌘ + K

Related tools

Frequently asked questions

Version 1.0.0 · Updated 2026-08-19 · Runs entirely in your browser