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.
Nearby workflows on Toolcore
- JSON formatter — when the sample still needs strict parse before you trust the inference.
- JSON → Haskell — when you need aeson records from the same JSON.
- Compare JSON — after you change the sample and want to see structural drift.
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 → Haskell records
ClientHaskell records with aeson Generic FromJSON/ToJSON from sample JSON—browser-side scaffolding.
YAML ↔ JSON
ClientYAML to JSON and JSON to YAML online—bidirectional converter, format either side in the browser.