JSON to Kotlin Data Class Generator

Free online JSON to Kotlin data class generator. Convert JSON data to Kotlin data class code with Gson/Moshi/Kotlinx serialization annotations, automatic recursive nested object support. Pure frontend, no data upload.

Updated: 2026-07-11

Frequently Asked Questions

๐Ÿ“Œ What annotation frameworks does the JSON to Kotlin generator support?

It supports three major frameworks: Gson (@SerializedName), Moshi (@Json or @field:Json), and Kotlinx Serialization (@Serializable). Choose the annotation style that matches your project serialization framework.

๐Ÿ“Œ Can the generated Kotlin code be used directly?

Yes. The generated data class includes val/var properties, default values, annotations, and companion object. Copy directly into your Android/Kotlin project. Make sure to add the corresponding serialization dependency.

๐Ÿ“Œ Does it support default values and null safety?

Yes. The tool offers nullable (T?) and non-null (T) modes. Null/missing fields automatically use nullable types. Numeric types support default value configuration - choose 0, 0.0, or no default.

๐Ÿ“Œ How are nested objects and generics handled?

Nested objects automatically generate independent data class definitions. Arrays become List<T> with generic type inference. Maps become Map<String, T>. The tool recursively processes all nesting levels.

๐Ÿ“Œ Is my data secure?

Absolutely. This tool runs 100% in your browser. Your JSON data is processed locally in memory and is never uploaded to any server. The data is cleared immediately after processing.

We Value Your Feedback!

Help us improve this tool. Share your suggestions, bug reports, or feature requests.

Copied!