Canonical: https://toolipedia.app/php-serialize-decoder

# PHP Serialized Data Decoder

Paste a PHP serialized string and read it as JSON, with correct UTF-8 byte lengths and class names, or turn JSON back into the PHP serialize format.

Breadcrumbs: Toolipedia > Developer tools > Code and developer utilities > PHP Serialized Data Decoder

## About PHP Serialized Data Decoder

PHP's serialize() writes arrays, strings, numbers, booleans and objects into one line such as a:2:{i:0;s:3:"cat";i:1;s:3:"dog";}. WordPress options, session files and caches store data this way. This decoder reads the format byte by byte, so string lengths are counted in UTF-8 bytes as PHP does, and shows the result as JSON: lists become arrays, other arrays become objects, and objects get a __class key. It also converts JSON back to serialize format and reports whether the round trip returns the identical text. It only reads the text and never runs PHP.

## How to use PHP Serialized Data Decoder
1. Choose whether to decode PHP text to JSON or encode JSON to PHP text.
2. Paste the serialized string or the JSON, or open a text file.
3. Copy the converted result and check the round trip line.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.

## Also known as
- php serialized data decoder
- php unserialize online
- php serialize to json
- json to php serialize
- decode serialized php string

## Frequently asked questions

### Why does a string length not match the number of letters?

PHP counts bytes, not characters. An accented letter such as e with an acute accent takes two bytes in UTF-8, so s:4 can describe a three-letter word.

### Is it safe to paste serialized data from an untrusted source?

Yes, here. The text is only parsed into JSON and no PHP code runs, so no object is created and no magic method is called. Unserializing untrusted data in PHP itself is a real risk.

### What are the odd characters in protected and private property names?

PHP marks them with NUL bytes, such as a star between two NULs for protected. The tool keeps them in the JSON key as a Unicode null escape so the round trip stays exact.

### Is PHP Serialized Data Decoder free?

Yes. PHP Serialized Data Decoder on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

## Related tools

More free tools that go well with PHP Serialized Data Decoder:
- [Date Format String Builder](https://toolipedia.app/date-format-string-builder)
- [JSON Minifier](https://toolipedia.app/json-minifier)
- [Base64 encoder / decoder](https://toolipedia.app/base64)
- [JWT decoder](https://toolipedia.app/jwt-decoder)
- [JSON Stringify and Unstringify](https://toolipedia.app/json-stringify-unstringify)
