JSON → Scala case classes
ClientPaste JSON to get final case class definitions with camelCase fields and Seq for arrays—add circe, play-json, or zio-json codecs in your project.
Learn more: JSON and Scala
Emit `final case class` definitions with camelCase fields and `Seq` for arrays—add circe, play-json, or zio-json codecs in your project.
Scope
Numbers default to Double; null in a sample maps to a comment suggesting Option types. Arrays infer from the first element only.
JSON → Scala
?
Parses JSON in your browser and emits classes inferred from the sample shape. Nested objects become nested types; arrays use the first element only to guess item shape. Nothing is uploaded.
final case class is a scaffold; add circe, play-json, or zio-json codecs and refine Option for missing fields.
Common use cases
- Outline case classes before adding circe or play-json codecs for HTTP clients and batch jobs.
- Compare inferred Seq shapes with real API payloads when keys use camelCase in Scala.
- Share sample JSON as structural notes in code reviews.
Common mistakes to avoid
Treating generated types as production codecs
Wire deriveDecoder, codecs, or manual decoders; nulls and numeric precision are not proven by one sample.
Ignoring Option for nullable fields
When a key is absent in other responses, use Option or a default—expand beyond the sample.
FAQ
Is Scala generation local?
Yes. Code is produced entirely in your browser.
Does this emit circe imports?
No—add io.circe.generic.semiauto or your stack’s imports in your own module.
More tools
Related utilities you can open in another tab—mostly client-side.
JSON → Elixir structs
ClientElixir defstruct modules with Jason.Encoder from sample JSON—snake_case atoms, local only.
JSON → Kotlin data classes
ClientKotlin data classes from sample JSON—nested types from one example, local only.
JSON formatter
ClientJSON format online: pretty-print, minify, validate, escape, download .json.
YAML ↔ JSON
ClientYAML to JSON and JSON to YAML online—format, validate, convert locally.