JSON to Swift
Convert JSON to Swift online for free — generate Codable structs from example JSON with CodingKeys where needed. No upload.
Swift output
// Generated by blackdroid.dev
struct Root: Codable {
let id: Int
let name: String
let email: String
let active: Bool
let balance: Double
let address: Address
let roles: [String]
}
struct Address: Codable {
let street: String
let city: String
let zip: String
}
// Note: AnyCodable requires the AnyCodable package for untyped fields.About JSON to Swift
Paste JSON and get Swift structs conforming to Codable — nested objects become their own structs, arrays become typed lists and snake_case keys map through CodingKeys.
The fast way to model an API response for URLSession or async/await networking. Generation runs locally in your browser — your JSON is never uploaded.