Back to Tools
PHP Serialize / Unserialize
PHP Serialize / Unserialize
Convert PHP objects and arrays into serialized strings and back
PHP Tool
Result
About the PHP Serialize / Unserialize
Convert PHP serialized strings to readable JSON and back.
How to use the PHP Serialize / Unserialize
- Paste your code into the input box, or click Load Sample to load an example.
- Choose Unserialize (to JSON/Readable) or Serialize (from JSON/Object) as the Action.
- Press Convert.
- Use Copy (or Download where shown) to keep the result. Clear empties the box.
Worked example
a:1:{s:1:"a";i:1;} is the serialised form of the array ['a' => 1].
Tips
- Never unserialize data from untrusted sources in your own code, as it can be unsafe.
Frequently Asked Questions
Untrusted serialized data can trigger unexpected code. Prefer JSON for data from users.