PHP Serialize ⇄ JSON Converter

Convert PHP serialize() output to JSON and JSON back to a serialized string — read the arrays and objects in sessions, cookies and cache. Free, no upload.

Output
{
  "0": 42,
  "name": "Ada"
}

🔒 Runs in your browser — nothing is uploaded.

Convert PHP serialize() output to JSON and back

Paste the output of PHP serialize() and get clean, indented JSON, or flip the direction to turn JSON into a PHP serialized string. The parser understands every scalar PHP emits — N (null), b (boolean), i (integer), d (float) and s (string) — plus a arrays nested to any depth. A PHP array whose keys are exactly 0,1,2,… becomes a JSON array; any other array becomes a JSON object, and when you convert back, numeric-looking object keys are re-cast to integer keys exactly as PHP does. Everything runs in your browser, so serialized session data never leaves your device.

Why inspect serialized data

PHP stores serialized values in many of the places you end up debugging: $_SESSION files, remember-me and framework cookies, the wp_options table in WordPress, Laravel and Symfony cache entries, and queued job payloads. A raw string like a:2:{s:4:"name";s:3:"Ada";i:0;i:42;} is hard to read at a glance — converting it to JSON shows the structure instantly, and converting JSON back lets you craft or patch a serialized value by hand. Because the length in s:N:"…" counts bytes and the content is not escaped, this tool reads strings that contain quotes or multi-byte UTF-8 correctly where a naive split would fail.

Frequently asked questions

What is PHP serialize() format?

It is the compact text format PHP uses to store a value as a string, such as a:2:{s:4:"name";s:3:"Ada";i:0;i:42;}. Each part is tagged by type — s for string, i for integer, a for array — with lengths and counts so PHP can rebuild the exact value with unserialize().

How does a PHP array become JSON?

An array with sequential integer keys 0,1,2,… becomes a JSON array. Any other array — string keys, or gaps in the numbers — becomes a JSON object. Converting back, an object key that looks like a plain integer is turned into an integer array key, matching PHP behaviour.

Is my data uploaded anywhere?

No. Parsing and conversion happen entirely in your browser with JavaScript. Nothing you paste is sent to a server, so it is safe to inspect real session, cookie or cache data.