FreeDev Tools

JSON to Swift

Generate Swift Codable structs from JSON β€” nested objects become nested structs, ready for JSONDecoder.

Runs locally in your browser. Your input is not uploaded.

How to Use

  1. 1

    Paste sample JSON

    Use a representative API response β€” the more complete the sample, the better the inferred types.

  2. 2

    Review the structs

    Nested objects become nested Codable structs. Check optionals and numeric types match your API contract.

  3. 3

    Copy into Xcode

    Copy the output into your project and decode with JSONDecoder.

Frequently Asked Questions

Swift structs conforming to Codable, with property types inferred from your JSON sample β€” String, Int, Double, Bool, arrays, and nested structs for nested objects.