Devkitr

PHP Serializer/Deserializer

Live

Serialize and deserialize PHP data format strings.

100% Private InstantFree forever
Serialized Output

Understanding PHP Serialization

PHP serialization converts PHP data structures — arrays, objects, strings, numbers, booleans, and null — into a string format that can be stored in databases, sessions, caches, and files. The serialize() function produces strings like a:2:{i:0;s:5:"hello";i:1;s:5:"world";} that encode the type, length, and value of each element. PHP serialized data is found in WordPress options tables, Magento configuration, Laravel cache entries, and legacy session storage — understanding and manipulating this format is essential for PHP application maintenance and data migration.

Work with PHP serialized data format — serialize JSON or structured data into PHP serialize() format, or deserialize PHP serialized strings back to readable JSON. Essential for debugging WordPress options, cached data, and legacy PHP applications that store serialized data in databases.

The Devkitr PHP Serializer/Deserializer converts between PHP serialized strings and readable JSON representations. Paste a serialized PHP string to see the data as JSON, or provide JSON to generate the PHP serialized format. This is particularly useful for inspecting WordPress database entries, editing serialized session data, and migrating PHP application data.

In a typical development workflow, PHP Serializer/Deserializer becomes valuable whenever you need to serialize and deserialize php data format strings. Whether you are working on a personal side project, maintaining production applications for a company, or collaborating with a distributed team across time zones, having a reliable browser-based processing tool eliminates the need to install desktop software, write one-off scripts, or send data to third-party services that may log or retain your information. Since PHP Serializer/Deserializer processes everything locally on your device, your data stays private and your workflow stays uninterrupted — open a browser tab, paste your input, get your result.

Key Features

Serialized-to-JSON Conversion

Parses PHP serialized strings and displays the data as formatted JSON, making complex nested arrays and objects readable.

JSON-to-Serialized Conversion

Converts JSON data into PHP serialized format for inserting or updating serialized values in PHP application databases.

Nested Structure Support

Handles deeply nested arrays, mixed types, and object references that are common in WordPress and Laravel serialized data.

Validation

Detects malformed serialized strings — incorrect string lengths, mismatched types, and truncated data — before attempting deserialization.

How to Use PHP Serializer/Deserializer

1

Paste Serialized Data

Copy a PHP serialized string from a database record, session file, or cache entry into the input area.

2

View as JSON

The tool parses the serialized data and displays it as formatted, readable JSON with proper nesting and data types.

3

Edit if Needed

Modify the JSON representation to change values, then convert back to serialized format for database storage.

4

Copy the Result

Copy the JSON for analysis, or copy the re-serialized PHP string for database insertion.

Use Cases

Inspecting WordPress Options

WordPress stores plugin settings and theme options as serialized PHP in the wp_options table. Deserialize them to read and understand configuration values.

Migrating PHP Application Data

Convert serialized PHP data to JSON for migration to non-PHP systems, or generate serialized strings from JSON for PHP database imports.

Debugging Session Data

Decode PHP session files to inspect stored user data, authentication state, and shopping cart contents during development.

Fixing Serialized String Corruption

When search-replace operations corrupt serialized data (by changing string lengths), identify and fix the broken serialization.

Pro Tips

Never run unserialize() on untrusted data in PHP — malicious serialized strings can trigger object injection attacks. Always validate and sanitize serialized input.

When doing WordPress database search-replace (like changing domains), use a serialization-aware tool — simple SQL REPLACE corrupts serialized strings by changing string lengths.

Consider migrating from PHP serialization to JSON storage — json_encode/json_decode is safer, faster, and interoperable with non-PHP systems.

Check serialized string lengths carefully — the number before the colon in string entries (s:5:"hello") must match the actual byte length of the string.

Common Pitfalls

Using SQL REPLACE to change values in serialized WordPress data

Fix: SQL REPLACE changes string content but not the serialized length counters, corrupting the data. Use WP-CLI search-replace or a serialization-aware migration tool.

Deserializing user-supplied data without validation

Fix: PHP unserialize() can instantiate arbitrary objects, triggering __destruct() and __wakeup() methods. Never unserialize untrusted input — use json_decode() for data exchange.

Assuming serialized data is human-readable

Fix: Serialized PHP format uses type prefixes and length counters that are not meant for human editing. Always deserialize to JSON, edit, then re-serialize.

Frequently Asked Questions

QWhat is PHP serialization?

PHP serialization converts data structures into a storable string format using serialize(). It is commonly used in WordPress for storing options and transient data.

QCan I deserialize WordPress data?

Yes. Paste WordPress serialized option values to see their actual structure as readable JSON.

QDoes it handle nested arrays and objects?

Yes. Nested arrays, associative arrays, strings, integers, floats, booleans, and null values are all supported.

Related Articles

Related Tools

You Might Also Need

More Dev Utilities