Generate PHP classes from JSON
JSON to PHP Class generates a class definition with one typed property per top-level JSON key — not a PHP array or object populated with your actual data — entirely in your browser. It uses PHP 7.4+ typed property syntax (e.g. public float $age;), so the output requires PHP 7.4 or later and is not compatible with PHP 5.4 as sometimes assumed.
Is JSON to PHP Class free to use?
Yes, it's completely free with no signup required.
Does it generate a PHP array or object containing my actual JSON data?
No — it generates a class definition with typed property declarations, such as public string $name;, not a populated array like ['name' => 'John'].
What PHP version does the generated code require?
PHP 7.4 or later, since it uses typed property syntax. It will not work on PHP 5.4 through 7.3.
Does it handle nested JSON objects?
No — only top-level keys become typed properties; nested objects are typed as mixed and arrays as array, without generating separate nested classes.