Developer tools
PHP json_decode & json_encode Online
Paste JSON to see exactly what json_decode() gives you, as PHP array code or print_r() output. Or paste a PHP array and get json_encode() output with the flags you choose.
- Runs in your browser
- Free, no sign-up
Converted in your browser. Nothing is uploaded.
How to use the PHP json_decode & json_encode Online
-
1
Choose json_decode (JSON → PHP) or json_encode (PHP → JSON) and paste your input. It converts as you type.
-
2
For decoding, choose arrays or stdClass objects and PHP code or print_r(). For encoding, tick the JSON_* flags you use.
-
3
Copy or download the result, or Swap to convert it back. The line at the bottom is the matching PHP code.