{}
JSON to DTO
JSON Input
Java Output
Paste JSON to get started.
Waiting for input
Java

JSON to DTO Converter for six languages

Paste JSON, get type-safe DTOs in Java, Kotlin, TypeScript, Python, Go, or C#. Built for developers who consume or design REST and RPC APIs and want the boilerplate gone.

How to use

  1. Paste a JSON payload into the JSON Input editor.
  2. Pick the output language from the tab strip.
  3. Set the root class name, package or namespace, and language-specific options (Lombok, Pydantic flavor, struct tags, etc).
  4. Copy or download the generated code.

Supported output

  • Java — POJO or Record, Lombok annotations (@Data, @Builder, @NoArgsConstructor, @AllArgsConstructor, @Getter, @Setter, @ToString, @EqualsAndHashCode), Jackson @JsonProperty.
  • Kotlin — data class or class, optional kotlinx.serialization @Serializable and @SerialName.
  • TypeScript — interface, type alias, or class. Optional export and readonly modifiers.
  • Python — @dataclass, Pydantic v2 BaseModel, or TypedDict. Optional + None defaults.
  • Go — struct with json tags, optional omitempty, optional pointer receivers for nested objects.
  • C# — class or record, System.Text.Json or Newtonsoft.Json attributes.

FAQ

Which languages does this tool support?
Java, Kotlin, TypeScript, Python, Go, and C#. Switch the output language from the tab strip above the generated code.
What is a DTO?
A DTO (Data Transfer Object) is a class used to carry structured data between processes, typically a client and a server. DTOs model the JSON payloads exchanged by REST and RPC APIs.
Does the Java output support Lombok and Jackson?
Yes. Toggle Lombok (@Data, @Builder, @NoArgsConstructor, @AllArgsConstructor, @Getter, @Setter, @ToString, @EqualsAndHashCode) and Jackson (@JsonProperty) independently. Lombok is disabled when you select Java Record.
What Python flavors are supported?
Three: standard library @dataclass, Pydantic v2 BaseModel, and typing.TypedDict. Optional + None defaults can be toggled for dataclass and Pydantic.
Can I share a converter setup with a teammate?
Yes. Click Share to copy a URL that encodes the JSON input and every option into the link hash. The recipient opens the link and sees the exact same state, no account required.
Is my JSON sent to a server?
No. The conversion runs entirely in your browser. No JSON, generated code, or option is sent to any server. The page works offline once loaded.
How are nested objects and arrays handled?
Nested JSON objects become separate classes (or inner classes for Java). Arrays become List<T>, []T, list[T], or T[] depending on the language. Empty arrays default to a permissive any/object element type.
Can I download the generated code?
Yes. Click Download to save the output to a file using the correct extension for the active language (.java, .kt, .ts, .py, .go, .cs).