PHP Serializer
Convert JSON data into PHP's serialize() format — the format used by WordPress, Drupal, and many PHP applications to store structured data in databases. If you're migrating data into a PHP application or debugging a serialized value in a database, this tool produces the exact format that PHP's serialize() function outputs.

What it does
- ▸Converts JSON objects to PHP serialize() format (a:2:{s:4:"name";s:3:"Ada";...})
- ▸Handles strings, integers, floats, booleans, null, and nested arrays
- ▸Preserves key-value structure and nesting depth
- ▸Outputs the exact format PHP's serialize() produces
Use cases
- ▸Migrating JSON data into a PHP application that expects serialized values
- ▸Generating test data for a PHP application that reads from its options table
- ▸Debugging a serialized value by comparing it against expected output
- ▸Preparing data for a WordPress wp_options or Drupal variable table
How it works
Paste your JSON into the input pane
The tool parses the JSON and converts each value to its PHP serialized form
Strings get length prefixes (s:4:"name"), arrays get count prefixes (a:2:{...})
Copy the serialized string for use in your PHP application or database
Frequently asked questions
1Does it handle nested objects and arrays?
Yes. Nested JSON objects become nested PHP arrays (a:N:{...}). The tool recursively serializes the entire structure, so deeply nested data works correctly.
2What about PHP objects (O:...)?
This tool serializes JSON to PHP arrays, not objects. PHP's serialize() can produce O:className:... for class instances, but since JSON doesn't have class information, the output uses arrays (a:...) which is the standard representation for structured data without class context.
3Can I use this with the PHP Unserializer tool?
Yes. The PHP Unserializer tool does the reverse — it takes a PHP serialize() string and converts it back to JSON. Chain them together to convert between formats in either direction.
Related tools
Use PHP Serializer offline in Devinity
All 95 tools run locally on your Mac. No internet required, no data sent to servers.
Download Devinity →


