Structured Data
JSON to PHP Array
Paste JSON and get readable PHP array syntax — a $data = [...] assignment,
a return [...] statement, or the bare array literal. Choose indentation, array
style and quoting, then copy or download. Everything runs in your browser.
JSON input
never uploadedParsed with the browser’s own JSON parser. Invalid input is reported with a line and column instead of a broken state.
PHP output
readyHow it works
Your input is parsed with JSON.parse() in this page and re-serialized as PHP
array literals. JSON objects and arrays both become PHP arrays, object keys are written as
'key' => value, and strings are escaped for the quote style you choose.
Because both JSON containers map to the same PHP type, an empty object and an empty array
both become []. The output is plain PHP and is never executed. Numbers keep
the value the browser parsed, so extremely large integers may already have been rounded.
Nothing is sent to a server; the optional share link keeps the state in the URL fragment,
which never leaves your browser.