toolbin_

Convert JSON to PHP Array Online

Convert JSON into an indented PHP array, right in your browser.

🔒 100% client-side — no data sent

Convert any JSON into a ready-to-paste PHP array. Conversion runs 100% in your browser: your data stays private and is never sent to a server.

What is it for?

  • Turn a JSON API response into a PHP array to embed directly
  • Generate a PHP configuration file from JSON data
  • Create PHP test fixtures from a JSON sample
  • Migrate JSON data into a Laravel or Symfony project

FAQ

How do I convert JSON to a PHP array?

Paste your JSON into the input field: the tool instantly produces an equivalent PHP array using the [] bracket syntax. Just copy the result into your code.

What is the difference between json_decode and this tool?

json_decode turns JSON into a PHP array at runtime. This tool instead generates the PHP array source code directly, which you can paste as a literal into a file without depending on a JSON string.

Does the tool handle nested JSON objects?

Yes. Nested objects and arrays are converted into associative and indexed PHP arrays, with correct indentation at every level of depth.

Related tools