ToolHub
Open Tool

JSON to Scala Case Class

Convert JSON data into Scala case class definitions with proper type mapping

Developer Tools

About This Tool

Convert JSON data into Scala case class definitions with proper type mapping. Generate clean Scala case classes from your JSON data with Option types, collection types, and popular JSON library codec support.

Key Features

Quick Preview

Use Cases

json scala case-class converter model functional

Frequently Asked Questions

What JSON libraries are supported?

The tool supports code generation for Circe and Play JSON libraries. Circe is a functional-style JSON library, while Play JSON is suited for Play Framework projects. You can choose your preferred library in the options.

How does Option type handling work?

When the Nullable option is enabled, fields with null values are wrapped in Option[T], indicating the field may be absent. This is the standard Scala approach to handling nullable values and prevents null pointer exceptions.

Can I customize the root class name?

Yes. You can set a custom root class name in the options. Nested case class names are derived from JSON key names in PascalCase.

How are nested objects handled?

Nested JSON objects are converted into separate case class definitions. The parent class references the nested class by type, producing clean, composable Scala code.

Is my data safe when using this tool?

Absolutely. All conversion happens locally in your browser. No JSON data is uploaded to any server, ensuring your information remains completely private and secure.