What it does
Paste a PHP array — either [ … ] short syntax or array( … ) — and get formatted JSON. Or paste JSON and get a clean, indented PHP array literal you can drop straight into code. Everything runs client-side; nothing you paste leaves the page.
PHP → JSON
Reads the common PHP array syntax: nested arrays, 'key' => value pairs, single- and double-quoted strings, integers, floats, true, false, and null. A PHP list (sequential integer keys) becomes a JSON array; an associative array becomes a JSON object.
JSON → PHP
Produces a readable, indented PHP array using array( … ) with => for object keys — the same shape you'd write by hand or get from var_export().
Example
PHP:
['name' => 'Ada', 'roles' => ['admin', 'editor'], 'active' => true]
JSON:
{
"name": "Ada",
"roles": ["admin", "editor"],
"active": true
}
Limitations
PHP → JSON understands array literals and scalars, not arbitrary PHP expressions (function calls, constants, variables, or heredocs). Working with WordPress wp_options values that are serialized rather than plain arrays? Use PHP Serialize & Unserialize instead.