Convert PHP classes and DTOs into JSON Schema, then open the Mock Generator to produce matching sample JSON.
Need JSON to PHP?
Convert JSON data to PHP code
Paste your PHP classes to produce a JSON Schema instantly.
Supports typed properties, DocBlock annotations, nullable/union types, arrays, and associative maps.
The converter reads class definitions with typed properties or DocBlock @var annotations, recognizing visibility modifiers, nullable types, arrays, and DateTime/UUID hints. Properties tagged as json-ignore or JsonIgnore are skipped automatically.
string, int, float, bool, array, and custom classes map to their JSON Schema counterparts. Nullable and union types mark fields optional, arrays become schema arrays, and array<string, T> patterns are treated as maps. Unknown classes fall back to string unless another PHP class with that name is defined.
Yes. You can paste DTOs, form requests, or entity classes with typed properties or DocBlock hints. The tool runs entirely in your browser, so your code never leaves your machine.
After generating the schema, click "Generate Mock Data" to open the Mock Generator with the schema preloaded. Configure locales and options to create sample payloads for docs or tests.