PHP Serialize & Unserialize Online — Free Serializer Tool

Serialize and unserialize PHP data instantly with our free online tool. Convert between PHP serialized format and JSON, edit serialized data safely, and debug WordPress or Laravel cache values. All processing happens in your browser — no data sent to any server.

Loading...
PHP Serialize
Using PHP's serialize() function to convert data into compact binary format

Basic example

Input JSON data

{ "name": "FastMinify", "version": "1.0.0", "features": ["minify", "compress", "optimize"] }

Serialized PHP data

a:3:{s:4:"name";s:10:"FastMinify";s:7:"version";s:5:"1.0.0";s:8:"features";a:3:{i:0;s:6:"minify";i:1;s:8:"compress";i:2;s:8:"optimize";}}

Serialization options

Include Null Values
Includes properties with null values in serialization

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 serialization
Remove Empty Arrays
Removes empty arrays before serialization

Comparison with/without option:

Original code
$data = [ 'name' => 'test', 'items' => [], 'active' => true, 'tags' => [] ];
With removeEmptyArrays: true
a:2:{s:4:"name";s:4:"test";s:6:"active";b:1;}
With removeEmptyArrays: false
a:4:{s:4:"name";s:4:"test";s:5:"items";a:0:{};s:6:"active";b:1;s:4:"tags";a:0:{}}
Difference
Empty arrays are removed de la sérialisation
Remove Empty Objects
Removes empty objects before serialization

Comparison with/without option:

Original code
$data = [ 'name' => 'test', 'config' => (object)[], 'active' => true, 'settings' => (object)[] ];
With removeEmptyObjects: true
a:2:{s:4:"name";s:4:"test";s:6:"active";b:1;}
With removeEmptyObjects: false
a:4:{s:4:"name";s:4:"test";s:6:"config";O:8:"stdClass":0:{};s:6:"active";b:1;s:8:"settings";O:8:"stdClass":0:{}}
Difference
Empty objects are removed before serialization
Sort Keys
Sorts associative array keys alphabetically

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
Array keys are sorted alphabetically

Features

Our PHP serialization tool offers a complete set of features for working with PHP serialized data.

Serialize PHP

Convert JSON data structures into PHP serialized format instantly. Supports arrays, objects, strings, numbers, booleans and null values.

Unserialize PHP

Decode PHP serialized strings back into readable JSON data. Restore original data structures from serialized format for debugging and analysis.

Convert PHP ↔ JSON

Seamlessly convert between PHP serialized format and JSON. Ideal for migrating data between PHP applications and modern APIs.

How to Unserialize PHP Data Online

PHP unserialization converts a serialized string back into its original PHP data structure. With FastMinify, you can unserialize PHP data directly in your browser — no server required. Simply paste your serialized PHP string in the left editor, and the tool automatically detects and decodes it. This is especially useful for debugging WordPress options, session data, or cached values stored in PHP serialized format.

PHP Serialize vs JSON — When to Use Which

PHP's serialize() format preserves type information including objects and references, while JSON is a universal interchange format. Use PHP serialization when working within PHP ecosystems (WordPress, Laravel, session storage). Use JSON when you need interoperability with JavaScript, APIs, or other languages. Our tool lets you convert between both formats with a single click using the JSON tool.

Editing Serialized PHP Data

Manually editing PHP serialized strings is error-prone because the format includes string length prefixes. Changing a single character can corrupt the entire structure. FastMinify solves this by unserializing to JSON, letting you edit the human-readable version, then re-serializing with correct lengths automatically.

Frequently Asked Questions

Everything you need to know about PHP serialization and unserialization

Why serialize PHP data?

PHP serialization converts complex data structures like arrays and objects into a compact string format for storage in databases, sessions, or cache. It preserves PHP-specific type information that JSON cannot represent, such as object classes and references.

How does PHP serialization work?

PHP's serialize() function encodes data with type prefixes and string length markers. For example, a string becomes s:5:"hello" where s indicates the type and 5 is the length. Arrays and objects are recursively serialized with their keys and values.

Can I unserialize PHP code online?

Yes, paste any PHP serialized string into our tool and it will decode it into readable JSON format. This works for arrays, objects, strings, numbers, booleans and null values. All processing happens in your browser for complete privacy.

Is my code processed securely?

Absolutely. All serialization and unserialization happens entirely in your browser using JavaScript. No data is ever sent to our servers, ensuring complete privacy and security for sensitive data.

What is the difference between PHP serialize and JSON?

PHP serialize preserves PHP-specific types (objects, class names, references) while JSON is a universal format. JSON is more portable across languages, but PHP serialization retains more type information. Use our tool to convert between both formats instantly.

Can I edit serialized PHP data?

Yes, our tool makes it easy. Paste the serialized string, let it decode to JSON, modify the data in the editor, then re-serialize. The tool handles string length calculations automatically, preventing corruption.

Is PHP unserialize safe?

In PHP applications, unserialize() can be dangerous with untrusted input due to object injection attacks. However, our browser-based tool processes data safely in JavaScript without executing any PHP code.

Can I serialize PHP arrays and objects?

Yes, our tool handles PHP arrays (both indexed and associative), objects, nested structures, strings, integers, floats, booleans, and null values. Enter your data as JSON and the tool converts it to valid PHP serialized format.

Other minification tools

PHP Unserialize Online — Free Serialize & Unserialize Tool