PHP Unserialize Online — Free Unserializer Tool

Decode PHP serialized strings into readable JSON or PHP array syntax. Inspect WordPress options, session data and cache blobs in your browser, without running any PHP object and without sending data to a server.

Loading…
PHP Unserialize
Decode PHP serialized strings into readable JSON to debug WordPress options, sessions and cache blobs in your browser.

Basic example

Serialized PHP input

a:5:{s:3:"app";s:10:"FastMinify";s:7:"version";s:5:"2.1.0";s:8:"features";a:3:{s:1:"0";s:6:"legacy";s:1:"1";s:6:"modern";s:6:"minify";b:1;}s:5:"flags";a:3:{i:0;b:1;i:1;b:0;i:2;N;}s:8:"metadata";a:2:{s:6:"author";s:4:"Team";s:7:"license";s:3:"MIT";}}

Decoded JSON output

{ "app": "FastMinify", "version": "2.1.0", "features": { "minify": true, "0": "legacy", "1": "modern" }, "flags": [true, false, null], "metadata": { "author": "Team", "license": "MIT" } }

Output formatting options

Include null values
On by default: properties set to null stay in the output. When off, null values are removed from objects and lists. The arrays that held them stay, even if they end up empty.

Comparison with/without option:

Original code
$data = [ 'name' => 'test', 'value' => null, 'active' => true, 'count' => null ];
With includeNullValues: true
a:4:{s:4:"name";s:4:"test";s:5:"value";N;s:6:"active";b:1;s:5:"count";N;}
With includeNullValues: false
a:2:{s:4:"name";s:4:"test";s:6:"active";b:1;}
Difference
Properties with null values are included in the output
Remove empty arrays
Off by default. Removes empty arrays ([]) at every depth, including inside lists.

Comparison with/without option:

Original code
$data = [ 'items' => [], 'name' => 'test', 'active' => true ];
With removeEmptyArrays: true
a:2:{s:4:"name";s:4:"test";s:6:"active";b:1;}
With removeEmptyArrays: false
a:3:{s:5:"items";a:0:{}s:4:"name";s:4:"test";s:6:"active";b:1;}
Difference
Empty arrays are removed from the result
Remove empty objects
Off by default. Removes keys whose value is an empty object ({}), at every depth, including inside lists.

Comparison with/without option:

Original code
{ "config": {}, "name": "test", "active": true, "settings": {} }
With removeEmptyObjects: true
a:2:{s:4:"name";s:4:"test";s:6:"active";b:1;}
With removeEmptyObjects: false
a:4:{s:6:"config";a:0:{}s:4:"name";s:4:"test";s:6:"active";b:1;s:8:"settings";a:0:{}}
Difference
Empty objects are removed from the result
Sort keys
Off by default. Sorts object keys at every depth by character code, so A–Z comes before a–z. Lists keep their order.

Comparison with/without option:

Original code
$data = [ 'zebra' => 'striped', 'apple' => 'red', 'banana' => 'yellow' ];
With sortKeys: true
a:3:{s:5:"apple";s:3:"red";s:6:"banana";s:6:"yellow";s:5:"zebra";s:7:"striped";}
With sortKeys: false
a:3:{s:5:"zebra";s:7:"striped";s:5:"apple";s:3:"red";s:6:"banana";s:6:"yellow";}
Difference
Object keys are sorted alphabetically in the output
Output indentation
Indentation of the decoded JSON or PHP array.

Indentation size

Spaces per level: 2 or 4. Ignored in tab mode, which uses one tab per level.

Indent type

Spaces or tabs in the decoded output.

What this unserializer does

Decode PHP serialized strings into readable JSON to debug WordPress options, sessions and cache dumps, entirely in your browser.

Unserialize PHP → JSON

Decode PHP serialized strings back into readable JSON or PHP array syntax, ready to inspect and edit.

In-browser parsing

The string is parsed by JavaScript in your browser and no PHP object is ever executed, so you can inspect untrusted array and scalar blobs. O: and R: payloads are not decoded.

Serialize JSON or a PHP array

Turn JSON into PHP serialize format with the PHP Serialize tool.

How to Unserialize PHP Data Online

Paste a PHP serialized string (for example a:3:{…}) into the left editor and select Unserialize. In the toolbar, choose JSON or PHP array syntax as the output format. The parser reads N;, b:, i:, d:, s: and a:, and rejects O: objects and R: references. The indent options shape the decoded output. To encode, use PHP Serialize.

Editing Serialized PHP Data Safely

Hand-editing s:n:"…" prefixes breaks the string easily. Decode it here, edit the readable JSON or PHP array, then serialize again with PHP Serialize, which recalculates the prefixes. Lengths are read and written in UTF-8 bytes, as PHP does. When a prefix is already wrong, the parser stops the string at its closing ";, so you can still read and repair it. It is not a tool for migrating WordPress databases.

PHP Unserialize FAQ

Decode serialized PHP to JSON in your browser

Can I unserialize PHP online?

Yes. Paste a PHP serialized string of arrays and scalars. It decodes to readable JSON or PHP array syntax. Processing stays in your browser.

Is PHP unserialize safe here?

In a PHP app, calling unserialize() on untrusted input can enable object injection. This tool parses the format with JavaScript in your browser and never runs PHP objects. It also does not decode O: class objects or R: references.

Can I edit serialized PHP data?

Yes. Unserialize to JSON or PHP array syntax, edit the result, then serialize it again with PHP Serialize. You no longer fix string-length prefixes by hand. This works for the array and scalar tokens this parser reads.

What input format do you accept?

Array and scalar serialize() tokens: a:, s:, i:, d:, b: and N;. Objects O:, references R: and truncated strings are rejected with an error. Strings are read by their declared length in UTF-8 bytes, so quotes and braces inside them are kept. A wrong length falls back to the closing ";.

Is my data processed securely?

Yes. Unserialization runs entirely in your browser. Nothing is uploaded to FastMinify servers.

Where do I serialize JSON?

Use PHP Serialize to turn JSON or a PHP array into a serialized string.

Verify it yourself

FastMinify processes your input in the browser. Inspect the network panel or read our validation gate to confirm nothing leaves your device.

Serialize and deserialize PHP data structures beside JSON workflows.