JSON to Kotlin Data Class Converter
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.
How to use
- Paste or type your JSON into the input box.
- Optionally rename the root class (defaults to AutoGenerated).
- 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
JSON to Java Class (POJO) Converter
Turn a JSON object into Java POJO classes with type-mapped fields, in your browser.
JSON to C# Class Converter
Turn a JSON object into C# classes with auto-property type mapping, in your browser.
Mock Data Generator
Generate realistic fake records for testing — names, emails, dates, IDs, lorem — exported as JSON, CSV, or SQL INSERTs.
CSV ↔ JSON Converter
Convert CSV to JSON and JSON back to CSV, with a delimiter option.
CSV → HTML / Markdown / JSON Table
Convert CSV to an HTML `<table>`, a Markdown table, or a JSON array of objects — auto-detects the delimiter.
HTML → JSX Converter
Paste an HTML snippet and get React-ready JSX — `class` becomes `className`, `onclick` becomes `onClick`, void tags self-close, inline styles can be object-ified.