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
Paste sample JSON
Use a representative API response β the more complete the sample, the better the inferred types.
- 2
Review the structs
Nested objects become nested Codable structs. Check optionals and numeric types match your API contract.
- 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.
Related Tools
JSON FormatterFormat, validate, and minify JSON with syntax highlightingJSON DiffCompare two JSON objects side-by-side and highlight differencesJSON to CSVExport JSON arrays to CSV with nested object flatteningCSV to JSONParse CSV files into structured JSON arraysJSON to XMLConvert JSON objects to XML with pretty-print outputXML to JSONParse XML and convert to clean JSONJSON to YAMLConvert between JSON and YAML formats bidirectionallyQuery String to JSONParse URL query parameters into JSON with nested support