JSON to Objective-C Converter
Convert JSON to Objective-C classes for Objective-C development
JSON Input
Objective-C Output
What Is JSON to Objective-C?
Objective-C uses NSDictionary and NSArray for raw JSON. NSJSONSerialization handles parsing. This tool generates Objective-C model classes from your JSON so you can map parsed data to typed properties instead of dictionary lookups. The JSON specification defines the input format.
Conversion runs in your browser. Set the class name in the config panel. Nothing is sent to a server. For new projects, consider JSON to Swift with Codable. For legacy Objective-C or mixed codebases, this tool is useful.
When JSON to Objective-C Helps
When building iOS or macOS apps with legacy Objective-C that consume REST APIs, generate model classes here. Use NSJSONSerialization to parse. For new projects, consider JSON to Swift.
How to Use This Tool
Paste or Upload JSON
Paste your JSON or upload a file. Set the class name in the config panel.
Review the Objective-C Output
The right panel shows generated classes. Use NSJSONSerialization to parse JSON and populate instances.
Copy or Download
Use Copy or Download. For formatting JSON first, use the JSON Formatter. For validation, use the JSON Validator.
JSON to Objective-C Examples
Here is an example of generating Objective-C classes from a JSON object.
Example: Subscriber record
JSON input:
Generated Objective-C output:
Frequently Asked Questions
Swift vs Objective-C?
Swift has Codable for automatic serialization. Objective-C uses NSJSONSerialization and manual mapping. This tool generates the model classes; you wire up the parsing in initWithDictionary: or similar.
What about Mantle or JSONModel?
Libraries like Mantle or JSONModel add automatic mapping. The generated classes can be adapted to work with those libraries. This tool provides the structure; you add the mapping logic.
Is my data private?
Yes. Generation runs entirely in your browser. No JSON or code is sent to any server.
Nullable types?
Use Type * or NSNumber * for optional JSON fields. Objective-C uses nil for absent values. The generator typically produces nullable pointer types for optional fields.
Can I use with Swift interop?
Yes. Objective-C classes are visible to Swift. You can use the generated classes in a mixed codebase. For new Swift-only code, prefer JSON to Swift.
Related Tools
NSJSONSerialization. JSON spec. MDN JSON. RFC 8259. Apple Developer.