Kotlin Data Classes to JSON Converter

Paste Kotlin data classes and get sample JSON with smart dummy values.

Turn Kotlin data classes into sample JSON fast

Paste one or more Kotlin declarations and get pretty JSON with believable dummy values. The converter understands nested data classes, value classes, typealiases, enums, nullable types, collections, constructor defaults, and kotlinx.datetime types.

Built for KMP and Android modeling work

Use it when you need mock API payloads, fixture JSON for tests, or a quick sanity check before wiring kotlinx.serialization. The output respects @SerialName and skips @Transient properties.

Strict type resolution

Referenced custom types must exist in the pasted source. If a property uses Profile but no Profile declaration is included, the tool reports that the type is undefined instead of guessing.

How to use the converter

  1. Paste Kotlin data classes, enums, aliases, and value classes into the input area.
  2. Choose the root data class when more than one is available.
  3. Toggle auto-fill on to generate sample values, or off to keep empty/zero placeholders.
  4. Regenerate to shuffle seeded dummy values without changing your Kotlin source.
  5. Copy the JSON output into tests, mocks, or API docs.

Example input

data class User(
    val id: String,
    val name: String,
    val email: String,
    val profile: Profile,
)

data class Profile(
    val city: String,
    val country: String,
)

FAQ