Skip to the generator

JSON to DTO Generator

From JSON to type-safe models. Swift, Kotlin, and Dart.

Your JSON never leaves your browser.

Type-safe models. Nothing guessed.

JSON to Swift Codable

Generates Codable structs or final classes with CodingKeys for renamed keys, plus optional Sendable, Equatable, Hashable, and memberwise initializers. Ready for Swift 6.

JSON to Kotlin data class

Generates @Serializable data classes for kotlinx.serialization, with @SerialName only where names differ and null defaults for optional properties. Integers use Int or Long by observed range.

JSON to Dart model

Generates null-safe classes for json_serializable with @JsonKey mappings, const constructors with named parameters, fromJson, toJson, and a matching part directive.

Nested model inference

Every nested object becomes its own model, named after its parent, such as UserAddress or UserPaymentMethod. Every element of an array is analyzed and merged, so properties that appear only in later items are kept.

Optional properties

DTOs describe external data, so every property is optional by default. Switch to inferred nullability to require properties that are present and non-null in every sample.

Serialization key mapping

snake_case, kebab-case, and other keys become idiomatic camelCase properties. The original key is preserved through CodingKeys, @SerialName, or @JsonKey, and colliding keys are never merged.

Unknown types, kept visible

A value that is always null, an empty array, or mixed types can’t be typed from a sample. Instead of guessing, it becomes a commented declaration with a TODO, and the code still compiles.

Strings stay strings

Types come from values, never from property names. Dates, URLs, UUIDs, and numeric strings remain String, matching what the JSON actually contains. Large integers are parsed without losing precision.

Local browser processing

Parsing and code generation run entirely in your browser. Your JSON and generated code are never uploaded, logged, stored, or added to the URL. Only your settings are saved on this device.

Questions? Answers.

Is my JSON sent to a server?

No. The page has no backend: parsing, inference, and code generation all run in JavaScript on your device. Your JSON is never uploaded, logged, stored, or included in analytics, so it’s safe to paste responses from production APIs.

Why are all properties optional by default?

A sample shows what one response contained, not what the API guarantees. Optional properties keep decoding working when a field is missing or null. Choose Inferred nullability to make properties required when every sample includes a non-null value.

What happens to null values and empty arrays?

Their type can’t be known from the sample, so the property is generated as a commented declaration with an UndefinedType placeholder and a TODO, along with its prepared key mapping. Replace the placeholder with the real type and uncomment the lines. If another sample has a concrete value, that type is used instead.

What do I need to use the generated code?

Swift needs nothing beyond the standard library and Foundation’s JSONDecoder. Kotlin needs the kotlinx.serialization Gradle plugin and JSON library. Dart needs json_annotation, plus json_serializable and build_runner to generate the .g.dart part file.