Convert JSON to PHP Array Online
Convert JSON into an indented PHP array, right in your browser.
🔒 100% client-side — no data sent
Convert any JSON into a ready-to-paste PHP array. Conversion runs 100% in your browser: your data stays private and is never sent to a server.
What is it for?
- ▸ Turn a JSON API response into a PHP array to embed directly
- ▸ Generate a PHP configuration file from JSON data
- ▸ Create PHP test fixtures from a JSON sample
- ▸ Migrate JSON data into a Laravel or Symfony project
FAQ
How do I convert JSON to a PHP array?
Paste your JSON into the input field: the tool instantly produces an equivalent PHP array using the [] bracket syntax. Just copy the result into your code.
What is the difference between json_decode and this tool?
json_decode turns JSON into a PHP array at runtime. This tool instead generates the PHP array source code directly, which you can paste as a literal into a file without depending on a JSON string.
Does the tool handle nested JSON objects?
Yes. Nested objects and arrays are converted into associative and indexed PHP arrays, with correct indentation at every level of depth.
Related tools
Base32 · encode / decode Encode and decode text to and from Base32 (RFC 4648) in your browser. Base58 encode/decode Encode and decode text in Base58 (Bitcoin, IPFS) right in your browser. Base64 · encode / decode Encode and decode text to and from Base64 (UTF-8), right in your browser. Base64URL encode/decode Encode and decode Base64URL (URL-safe variant used in JWT), in your browser. BBCode → HTML Convert forum BBCode into clean, sanitized HTML, right in your browser. Text ↔ binary Convert text to binary (ASCII/UTF-8) and back.