Skip to content

PHP Serialize to JSON Converter

Unserialize a PHP string into JSON — and back — with byte lengths handled and repairable.

Drop a file here, or click to choose one

Converted on your device — the file is never uploaded

Result

Quick Tool Overview

The PHP Serialize to JSON Converter unserializes a PHP string into readable JSON and back again, counting string lengths in bytes as PHP does and repairing them when they no longer match.

What it does
Unserializes PHP data to JSON, and back
You give it
A serialized string, or JSON
You get back
Readable JSON, or a serialized string
Best for
WordPress options and legacy database columns
Converters Free, unlimited use No sign-up Runs in your browser

About the PHP Serialize to JSON Converter

WordPress options, Magento configuration, session files, queue payloads and countless legacy database columns store PHP serialized strings: a:3:{s:4:"name";s:3:"Ada";…}. They are unreadable by eye, and the moment one is edited or moved between character sets the byte lengths stop matching and PHP refuses to read it at all.

Paste a serialized string and read it as JSON: nested arrays, objects with their class names, booleans, floats, references and enum values. String lengths are counted in bytes, exactly as PHP does, so multibyte text is handled correctly — and when the lengths are wrong, the repair option re-reads each string to its real end and tells you how many it fixed. It works the other way too, turning JSON into a serialized string you can write back. Nothing is executed: unserialize() on untrusted data can trigger PHP magic methods, while reading it as text here cannot.

Key features of the PHP Serialize to JSON Converter

Broken lengths repaired

Data damaged by an edit or a charset change can be re-read, with a count of what was fixed.

Objects and visibility

Class names are kept, and private and protected property names are cleaned up.

Byte-accurate

Lengths are counted in UTF-8 bytes, so multibyte text round-trips correctly.

Both directions

Edit the JSON and serialize it again, ready to write back.

Safe to paste

Nothing is executed — unlike a real unserialize() on untrusted input.

How to use the PHP Serialize to JSON Converter

  1. 1

    Paste the serialized string

    Straight from a database column, a session file or a log.

  2. 2

    Read the JSON

    The direction is detected; objects keep their class under __class.

  3. 3

    Repair if it complains

    Turn on repair when a string length no longer matches the data.

  4. 4

    Go back if you need to

    Edit the JSON and switch direction to get a serialized string again.

Frequently asked questions

Because the byte length in s:N: no longer matches the string — usually after an edit, a search-and-replace, or a change of database character set. The repair option re-reads each string and reports how many were wrong.

Reviews of the PHP Serialize to JSON Converter

What people who use the PHP Serialize to JSON Converter think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the PHP Serialize to JSON Converter. It takes half a minute and no account.

Write the first review

More converters