AZ Tools

JSON to Kotlin Data Class Converter

Developer

Paste any JSON object or array and get ready-to-use Kotlin `data class` definitions with typed `val` properties (String, Long, Double, Boolean, List<...>) and separate classes for nested objects. Everything runs locally in your browser — your JSON is never uploaded.

Kotlin data classes

How to use

  1. Paste or type your JSON into the input box.
  2. Optionally rename the root class (defaults to AutoGenerated).
  3. Copy the generated data classes from the output box.

Frequently asked questions

How are numbers typed?
Whole numbers become Long and numbers with a decimal point become Double. Change to Int or Float manually if you prefer a narrower type.
What happens with null or empty arrays?
null values map to a nullable Any? and empty arrays to List<Any>, since their type can't be inferred from the sample.
How are nested objects handled?
Each nested object becomes its own data class. An empty object becomes a plain class, since a data class needs at least one property.
Is my JSON sent anywhere?
No. Conversion happens entirely in your browser; nothing is uploaded.

Related tools