Php Serialize
Free online php serialize tool, no installation required
About PHP Serialize
Converts between JSON and PHP's native serialize() format. Serialize mode takes a JSON value (object, array, string, number, boolean, or null) and emits the corresponding PHP serialization. Unserialize mode parses a PHP-serialized string and renders it back as pretty-printed JSON. Sequential numeric arrays are detected and returned as JSON arrays; associative arrays become JSON objects.
How to Use
1. Pick a mode with the Serialize / Unserialize buttons. 2. In Serialize mode, paste valid JSON into the input (e.g. {"name":"Alice","age":30}). In Unserialize mode, paste a PHP-serialized string (e.g. a:2:{s:4:"name";s:5:"Alice";s:3:"age";i:30;}). 3. Click Serialize or Unserialize. The output area shows the converted result; a toast confirms success. 4. Use Copy to copy the output and Clear to reset both fields.
PHP Serialization Type Codes
The PHP format uses single-letter type prefixes: N; for null, b:0;/b:1; for booleans, i:<n>; for integers, d:<n.n>; for floats/doubles, s:<len>:"..."; for strings, and a:<count>:{...} for arrays. Arrays are key/value pairs where each entry is two serializations back to back. Sequential integer-keyed arrays (keys 0,1,2,...) are decoded to JSON arrays; any other key shape produces a JSON object.
▶Why does my sequential array decode to a JSON array but my keyed array decodes to an object?
▶Can I serialize a raw PHP object (O:...)?
▶Why does serialize fail with a parse error?
▶Are string lengths byte-based or character-based?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee