PHP Array to JSON Converter
Transform PHP array syntax into formatted JSON for APIs, configs, and data pipelines without sending code to a server.
Turn PHP array literals into JSON
API docs, front-end mocks, and integration tests often need JSON even when the source config is still written as a PHP array in a bootstrap file. This converter parses real PHP array syntax and emits JSON you can validate or pipe into other tools.
Validate output with the JSON Validator or convert back to PHP with the JSON to PHP Array Converter.
Frequently Asked Questions
Can I paste a full PHP assignment?
Yes. Lines like $config = [ ... ]; are accepted; the tool unwraps the assigned array before serializing to JSON.
How are PHP booleans and null handled?
They become JSON true, false, and null respectively, matching standard JSON semantics.
Does pretty-print change the data?
No. Pretty-print only adds indentation and line breaks; the parsed values stay the same.