JSON ↔ Swift Converter
JSON ↔ Swift Converter
Cancel

JSON ↔ Swift Converter

Paste JSON to generate Swift 5.5+ Codable structs, or paste a Swift struct to generate sample JSON test data. Everything runs locally in your browser — nothing is uploaded:

  • JSON → Swift (Codable): infers types automatically (String / Int / Double / Bool / arrays / nested objects), generates CodingKeys for snake_case conversion and supports nested structs and arrays.
  • Swift → Sample JSON: parses struct property names and types to produce sensible sample values (including nested structs), handy for building Codable test fixtures.
  • Dual language output: switch between Swift structs and Objective-C @property declarations.
  • Snake-case toggle: snake_casecamelCase, automatically deciding whether CodingKeys are needed.
  • One-click copy / clear / load sample.
JSON ⇄ Swift Codable · 100% local · nothing uploaded
Code style

Tip: click "JSON → Swift" to convert the JSON on the left; click "Swift → Sample JSON" to turn the Swift struct on the left into sample JSON. The Objective-C tab only applies to JSON → Swift.