JSON to Kotlin

Generate Kotlin data classes with nullable types from a sample JSON document.

Generate Kotlin data classes

Result: —
Every class is named from the key path, arrays become List types and values that can be missing become nullable.

How to use the JSON to Kotlin

  1. Paste a JSON sample into the input box.
  2. Set the name of the root data class.
  3. Click Generate classes and copy the Kotlin code.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online json to kotlin.

Paste a JSON sample, set the root class name and click Generate classes. Every object shape becomes a data class with typed properties.
Text becomes String, whole numbers become Int or Long, decimals become Double, booleans become Boolean and arrays become List types.
A field that can be null gets a question mark, so text becomes String with a question mark and unknown values become Any with a question mark.
A data class needs at least one property, so an object with no keys is emitted as a plain class instead, which still compiles cleanly.
Nested objects become their own classes named from the key path, so an address inside a user object becomes UserAddress.
Keys are converted to camel case property names, and reserved words get a Value suffix so the generated code always compiles.
No. Generation happens entirely in your browser, so your document stays on your device and is never stored.
Text that is not valid JSON, or a sample that is neither an object nor an array, shows a clear error message instead of code.

Last updated: October 10, 2026