json2apex.com
Best JSON to Apex Converter
Home
About
FAQ
Dark Mode
Instant JSON to Apex Converter for Salesforce Developers
Generate Apex classes and tests in seconds. Paste your JSON below!
How to Use json2apex
Enter your desired Apex class name (default: WrapperClass).
Check or uncheck "Include Parse Methods" as needed.
Paste your JSON input or upload a JSON file.
Click "Generate Class" to create the Apex code and test class.
Copy the output or download the classes as a ZIP file.
Key Features
Supports complex JSON structures, including nested objects and arrays.
Generates complete Apex classes with optional parse methods.
Includes automated test classes for easy validation.
Dark mode toggle for comfortable viewing.
Free and fast—no sign-up required.
Apex Class Name
Include Parse Methods
JSON Input
Upload JSON File
{"name": "John", "age": 30, "isActive": true, "details": {"city": "New York", "zip": 10001}, "hobbies": ["reading", "gaming"], "contacts": [{"name": "Alice", "phone": "123-456-7890"}]}
Generate Class
Clear Input
Download Classes
Generated Apex Class
Copy
Copied!
Generated Test Class
Copy
Copied!