Free online JSON to Swift struct code generator. Convert JSON data to Swift struct code with Codable conformance, CodingKeys, nested object support, and automatic type inference. Pure frontend, no data upload.
It supports String, Int, Double, Bool, Date (ISO 8601), [Any] (arrays of any type), and [String: Any] (dictionaries). Arrays generate Array<T>, nested objects generate child structs. All structs conform to Codable by default.
Yes. The generated struct includes Codable conformance and CodingKeys enum. Copy directly into your Xcode project. If JSON keys use snake_case while Swift uses camelCase, the tool handles the mapping automatically.
Yes. The tool generates CodingKeys based on JSON field names by default. You can toggle CodingKeys generation on/off. When disabled, Swift uses automatic key mapping (requires exact key name matching).
If a field is missing or null in the JSON, the tool maps it as an Optional type (e.g., String?). You can choose whether to use Optional for all fields or only for null/missing fields.
Absolutely. This tool runs 100% in your browser. Your JSON data is processed locally in memory and is never uploaded to any server. The data is cleared immediately after processing.
Help us improve this tool. Share your suggestions, bug reports, or feature requests.
Submit Feedback