JSON to PHP Converter

Convert JSON data into PHP arrays or stdClass objects with configurable syntax options.

How to Use

  1. Paste JSON or upload a .json file.
  2. Choose output type (array or object), syntax, and formatting.
  3. Copy or download the PHP code.

Frequently Asked Questions

What PHP output formats are supported?

The tool generates either associative arrays ($data = [...]) or stdClass objects ((object)[...]). You can choose short bracket [] or long array() syntax.

Does it handle nested JSON?

Yes. Nested JSON objects become nested PHP arrays or objects, and arrays become indexed PHP arrays.

Can I add a variable assignment?

Yes. Enable "$var =" to wrap the output in a variable assignment like $data = [...]; with a configurable variable name.

Is my data secure?

Yes. All conversion happens in your browser. Nothing is uploaded to any server.

Related Guides