Serialized data inspector
Read PHP serialized strings as a tree, find wrong string lengths after a search-and-replace, and rebuild them with correct byte counts. Parsed safely in your browser.
No account, uploads or PHP execution. Your inputs stay on this device.
What this tool does
It reads the format written by PHP's serialize(): N; for null, b: booleans, i: integers, d: floats, s: strings, a: arrays, O: objects, C: custom-serialized objects, E: enums (PHP 8.1+) and r:/R: references. It shows the result as a tree you can expand, and as JSON.
Objects are never created. The class name is shown next to the properties, and private or protected properties (which PHP stores with hidden NUL-byte prefixes) are labelled. That makes it safe to paste data you do not trust, unlike calling unserialize() on it.
Finding and fixing wrong string lengths
Every string is stored as s:LENGTH:"value";, where LENGTH is in bytes of UTF-8. After a find-and-replace on a database dump, or when an editor changed the encoding, lengths stop matching and PHP's unserialize() fails with "Error at offset X of Y bytes". With repair switched on, this tool finds the real end of each string, lists every mismatch, and rebuilds the value with correct lengths. In the example above, https://new-domain.example is 26 bytes but declared as 23, and Café blog is 10 bytes, not 9, because é takes two bytes.
Repair is a best guess when a broken string itself contains ";. Check the tree before writing a repaired value back, and keep a backup. Why this happens, and how to avoid it, is in serialized data broken after search-and-replace.
Unserializing safely in PHP
$data = unserialize($value, ['allowed_classes' => false]); // objects become __PHP_Incomplete_Class
// or, if you only expect specific classes:
$data = unserialize($value, ['allowed_classes' => [Money::class]]);Never call unserialize() on user input without allowed_classes: magic methods such as __wakeup() and __destruct() on any loaded class can run, which is the basis of PHP object injection attacks. For new data, prefer JSON.