PHP Serialize & Unserialize

Convert between JSON and PHP's serialize() format. Inspect WordPress options, session data, and cached values. Runs entirely in your browser.

Loading tool...

How to Use This Tool

  1. 1

    Paste a PHP serialized string into the PHP Serialized panel and click Unserialize to see it as formatted JSON.

  2. 2

    Alternatively, type or paste JSON into the JSON panel and click Serialize to produce the PHP serialized string.

  3. 3

    PHP objects are represented in JSON using a __class__ property — for example, {"__class__": "stdClass", "name": "Alice"} becomes O:8:"stdClass":1:{s:4:"name";s:5:"Alice";}.

  4. 4

    Click Copy to copy the output to your clipboard, or use Share to generate a URL that pre-fills the tool with your data.

What is PHP Serialize?

PHP's serialize() function converts a PHP value — strings, integers, arrays, objects — into a storable string representation. The format uses type markers and length prefixes to encode the data structure: s:5:"hello"; for a string, i:42; for an integer, a:2:{...} for an array, and O:8:"stdClass":1:{...} for an object. Unlike JSON, PHP serialization preserves type information exactly, including the distinction between indexed and associative arrays and the class name of objects.

You'll encounter PHP serialized data constantly if you work with WordPress — the wp_options table, transients, widget settings, and user metadata all store values in this format. It's also used in PHP session files, cache backends like Memcached and Redis when configured with PHP's default serializer, and legacy APIs that predate the widespread adoption of JSON. Any time you see a string starting with a: or s: followed by a number and a colon, you're likely looking at PHP serialized data.

A client-side unserializer is particularly valuable because serialized data from databases often contains sensitive information — user records, API keys stored in plugin settings, session tokens. Our tool processes everything locally in your browser using JavaScript, so your data never leaves your machine. You can safely paste production database values, inspect their structure as formatted JSON, modify them, and re-serialize without any privacy risk.

Frequently Asked Questions

helpIs my data sent to a server?

No. All serialization and unserialization runs entirely in your browser using JavaScript. Your data never leaves your device.

helpHow are PHP objects represented in JSON?

PHP objects are represented as JSON objects with a special __class__ property set to the original class name. For example, a stdClass object with a name property becomes {"__class__": "stdClass", "name": "value"}. When serializing back to PHP format, any JSON object containing a __class__ string property is emitted as an O: (object) marker.

helpCan I use this to edit WordPress wp_options values?

Yes. Copy the serialized value from your wp_options row, paste it into the PHP Serialized panel, and click Unserialize to see the structured data as JSON. Edit the JSON, click Serialize, and paste the result back into your database. Always back up your database before modifying serialized values — an incorrectly formatted string will cause PHP to fail when unserializing.

helpDoes this support nested arrays and objects?

Yes. The parser handles arbitrarily nested structures — arrays containing objects containing arrays, and so on. The JSON output preserves the full nesting hierarchy so you can inspect and edit deeply nested values.

Related Tools