IQ
PayloadIQ
PayloadIQ Utilities

JSON to Kotlin

Paste a JSON sample and get @Serializable Kotlin data classes back — val properties, nested classes, List types and @SerialName for non-identifier keys. It all runs in your browser.

Kotlin data classes appear here.

Runs in your browser. Your input is not uploaded to PayloadIQ.

JSON to Kotlin turns a JSON sample into @Serializable data classes you can paste into your project. Properties are val with inferred types (Int, Double, Boolean, String, List<T>), nested objects become their own data classes, and a JSON key that isn't an idiomatic Kotlin identifier gets a @SerialName so (de)serialization round-trips. Everything runs locally in your browser, so a real API response never leaves your machine.

kotlinx.serialization-ready

Each class is annotated @Serializable and the needed imports are emitted, so the output drops straight into a project using kotlinx-serialization. Rename the root class with the Root-name field.

Inference is sample-driven

The generator can only see what you give it, so paste the richest payload you have, and review numeric types (Int vs Long) and nullability afterwards. Want types in another language from the same payload? Try JSON to Go or JSON to Rust, or open the PayloadIQ playground.

FAQ

Is my JSON uploaded?
No. The JSON is parsed and converted entirely in your browser with JavaScript — it never leaves your device. That makes it safe for real API responses, auth payloads, and anything internal.
Which serialization does it target?
kotlinx.serialization: every class is annotated @Serializable and the needed imports are included, so you can drop the output into a project using the kotlinx-serialization-json library and start (de)serializing.
How are keys and types mapped?
Properties are val and named in idiomatic camelCase. Whole numbers become Int and decimals Double; booleans Boolean; strings String; arrays List<T>; nested objects their own data classes. When a JSON key isn't a clean Kotlin identifier (for example is_active), a @SerialName("is_active") keeps (de)serialization lossless.
How complete is the inference?
It is sample-driven, so paste a representative payload. The generator can't know a field is sometimes null or sometimes a Long unless the sample shows it — so review nullability and numeric types (Int vs Long) for fields that may vary.

Related utilities

JSON to GoJSON to RustJSON to TypeScriptJSON Formatter / ValidatorJSON VisualizerJSON MinifierJSON DiffJSON to CSV
Open PayloadIQ Playground