Convert PHP serialized strings into readable JSON. Paste a serialized value and inspect its structure instantly.
Paste a valid PHP serialized string (e.g. from serialize(), a database dump, or a cache store) and click Unserialize to view it as formatted JSON.
Unserialize PHP Serialized Text takes a PHP serialized string — the output of PHP's serialize() function — and converts it into a readable, pretty-printed JSON representation. PHP's serialization format is a compact, type-prefixed string notation: strings are encoded as s:5:"hello", integers as i:42, floats as d:3.14, booleans as b:1 (true) or b:0 (false), null as N;, arrays as a:N:{...} with key-value pairs, and objects as O:class_name:count:{...}. The tool implements a full JavaScript-based parser that reads this notation token by token, recursively resolving nested structures, custom serialized objects, and even internal references (r:N). The parsed result is then serialized to formatted JSON with 2-space indentation, making even deeply nested serialized data immediately comprehensible.
a:2:{i:0;s:5:"hello";i:1;s:5:"world";}session_encode(), cached API responses, or serialized queue messages, this tool helps you verify that the data being stored and retrieved matches your expectations.What does a PHP serialized string look like?
A typical array serialization looks like a:3:{i:0;s:5:"apple";i:1;s:6:"banana";i:2;s:5:"cherry";}. The a:3 means "array with 3 elements", i:0 is integer key 0, s:5:"apple" is a 5-character string "apple", and so on. An object looks like O:8:"stdClass":1:{s:4:"name";s:4:"John";}.
Does the tool support serialized objects?
Yes. The parser handles PHP objects (the O: type) and custom serialized objects (the C: type), outputting them as JSON objects with their class name preserved in a __php_class__ property for transparency.
What happens if the serialized string is invalid?
The parser returns a descriptive error message indicating where the parse failed — for example, "Unexpected token at position 42: expected string length". This helps you identify truncated data, manual editing errors, or corruption in the serialized string.
Can I convert JSON back to a PHP serialized string?
This tool is one-directional — it only unserializes PHP to JSON. If you need to go the other direction, PHP's unserialize() and serialize() functions or a dedicated serialization library would be appropriate.