Advertisement

JSON to PHP Array

Convert JSON to PHP Array free, in seconds. Paste your data below, press Convert, then copy the result and paste it into your PHP config or seeder. Everything runs in your browser, so nothing is ever uploaded.

JSON input

Paste your JSON below, then press Convert.

Tip: arrays of objects convert best. A single object becomes one row.

PHP Array output

Waiting for JSON input.

Private by design: conversion runs entirely in your browser with built-in code, so your data never leaves your device.
Advertisement

How this conversion works

Paste JSON into the input box and press Convert (or just keep typing, conversion happens as you type). The tool parses it with the browser's native JSON parser, then emits modern PHP short array syntax wrapped in a

Using the PHP output

The output uses modern short array syntax with 'key' => value pairs and is wrapped in <?php return [...]; so the file works the moment you save it as a .php file. Strings are single-quoted, numbers stay numeric, booleans become true or false, and missing values become null. Paste it straight into a Laravel config file, a Symfony parameter file or a database seeder.

JSON to PHP Array FAQs

Why convert JSON to a PHP array?
PHP config files in Laravel, Symfony and WordPress are plain PHP arrays. Converting data to PHP array syntax lets you paste it straight into a config file or seeder instead of hand-writing the structure.
How is my JSON parsed?
With the browser's native JSON parser, so even large documents convert fast. An array of objects becomes one row per object, a single object becomes a single row, and nested values are flattened with dot notation (for example contact.city).
What does the output look like?
Modern short array syntax with 'key' => value pairs, wrapped in <?php return [...]; so the saved file works immediately when included from PHP.
How are data types handled?
Strings are single-quoted with inner quotes escaped, numbers stay numeric, booleans become true or false, and missing values become null.
Is my data sent to a server?
No. conversion runs entirely in your browser with built-in code, so your data never leaves your device.
Advertisement