JSON to PHP
Convert JSON into a PHP array you can paste into a script. Conversion runs in the browser.
About JSON to PHP
Convert JSON to a PHP array with this free online JSON to PHP array converter. Paste an API response, config snippet, or fixture file and get a ready-to-paste PHP array literal with correct nesting, quoting, escaping, and indentation. Nested objects become nested arrays, JSON null maps cleanly, and strings are quoted so the output is valid PHP you can drop into a class, seeder, or test.
It suits Laravel, Symfony, WordPress, and plain PHP projects where you need JSON data as native PHP code instead of decoding it at runtime. Backend developers use it to turn sample API payloads into array fixtures, to prototype config, and to move data from a .json file into a PHP migration or factory. Students learning PHP can see how JSON keys become array keys without writing a throwaway script.
The converter is built for real documents, not just tiny examples. Deeply nested objects, lists of records, mixed types, and empty arrays are preserved so the PHP output matches the original structure. Copy the result and paste it into your editor. If the JSON is invalid, you get a parse error before any PHP is generated, which saves time hunting syntax mistakes.
The conversion runs entirely in your browser, so no JSON is uploaded or stored anywhere. Tokens, customer data, and internal configs stay on your machine. Use this free JSON to PHP converter whenever you need an array literal fast, with no sign-up and no server round trip.