PHP Array to JSON Converter

Paste or upload a PHP array and convert it to valid JSON in one click.

Converted JSON

About this tool

When you need to move data defined as a PHP array into a JSON context — a JavaScript file, an API response mock, or a config file — retyping it by hand is tedious and error-prone. This tool takes PHP array syntax (including => arrows and single-quoted strings) and rewrites it as valid JSON.

Paste your array directly or upload a .php file, then copy the converted JSON output.

Limitations

This is a syntax-level conversion aimed at typical flat and nested arrays; deeply dynamic PHP (variables, function calls, or expressions inside the array) should be resolved to static values first for a clean conversion.