JSON to Swift

Convert JSON data to Swift Codable Struct using quicktype engine. Supports struct/class style switching.

Usage

Features

Based on quicktype engine, this tool automatically converts JSON data to Swift Codable Struct/Class with type inference and multiple rendering options.

Options

  • Root type name: The top-level type name to generate, defaults to Root.
  • Type style: struct (value type, default) or class (reference type).
  • Access level: internal (module-visible, default) or public (cross-module visible).
  • Just types: Only generate type definitions, no helper encoding/decoding code.
  • Mutable properties (var): Use var instead of let to declare properties.

Steps

Enter or paste JSON data in the left text box, set the root type name and rendering options. Swift code will be generated in real time.

Notes

Number types are automatically inferred as Int or Double. null values become Optional. Arrays become [T].