PHP Serialize Online — JSON or PHP Array to serialize()
Convert JSON or PHP array syntax into PHP serialize() format instantly. Ideal for WordPress-shaped arrays, Laravel cache values and session storage. All processing happens in your browser — no data sent to any server.
Basic example
Input JSON data
Serialized PHP data
How to Serialize PHP Data Online
Paste JSON or PHP array syntax in the left editor. Leave Input format on Auto unless detection picks the wrong parser, then click Serialize. FastMinify stays in your browser and emits array and scalar tokens (a:, s:, i:, d:, b:, N;). Nested JSON objects become PHP arrays — not O: class objects or R: references. To decode an existing a:3:{…} string, use PHP Unserialize.
PHP Serialize vs JSON — When to Use Which
JSON is what you edit here; PHP serialize() is the compact string many PHP apps store (WordPress options, Laravel cache, sessions). Use JSON for APIs and other languages; use this page when a PHP stack already expects serialize() output. This encoder does not keep class names or references. Pretty-print or minify the JSON side with the JSON tool.
Serialization options
JSON
PHP array
Both produce the same serialize() array tokens:
Comparison with/without option:
Original code
With includeNullValues: true
With includeNullValues: false
Difference
Comparison with/without option:
Original code
With removeEmptyArrays: true
With removeEmptyArrays: false
Difference
Comparison with/without option:
Original code
With removeEmptyObjects: true
With removeEmptyObjects: false
Difference
Comparison with/without option:
Original code
With sortKeys: true
With sortKeys: false
Difference
What this serializer does
Serialize JSON or PHP array syntax into serialize() strings for WordPress-shaped arrays and Laravel caches — entirely in your browser.
Convert JSON or PHP array syntax into PHP serialize() format. Arrays, strings, numbers, booleans and null. Nested JSON objects are emitted as PHP arrays.
Use when you edit data as JSON or a PHP array and need serialize() output for options, cache values or session-shaped arrays.
Paste a PHP serialized string into the PHP Unserialize tool to decode it to readable JSON or PHP array syntax.
PHP Serialize FAQ
Serialize JSON to PHP — privacy-local answers
Why serialize PHP data?
PHP stacks store arrays in a compact serialize() string for databases, sessions or cache. This page encodes JSON or PHP array syntax into those array and scalar tokens — it does not emit class objects or references.
How does PHP serialization work?
PHP's serialize() encodes data with type prefixes and string length markers. For example, a string becomes s:5:"hello" where s is the type and 5 is the length. Arrays are serialized recursively. JSON objects become a: arrays here, not O: class objects.
Can I serialize PHP arrays and objects?
Paste JSON or PHP array syntax: indexed or associative arrays, nested maps, strings, numbers, booleans and null. Nested JSON objects are emitted as PHP arrays. PHP class objects (O:) and references (R:) are not produced.
What is the difference between PHP serialize and JSON?
JSON travels across languages; serialize() is the wire format many PHP apps store. Encode JSON or a PHP array here; decode a serialized string with PHP Unserialize.
Is my data processed securely?
Yes. Serialization runs entirely in your browser with JavaScript. No payload is sent to FastMinify servers.
I need to decode a serialized string instead — where?
Open PHP Unserialize. That dedicated page decodes serialized PHP into readable JSON or PHP array syntax.
Verify it yourself
FastMinify processes your input in the browser. Inspect the network panel or read our validation gate to confirm nothing leaves your device.
Serialization
Serialize and deserialize PHP data structures beside JSON workflows.
Explore other tool categories
Minify
Shrink code and assets for production — minify JavaScript, CSS, HTML, JSON and XML before gzip or CDN deploy.
Unminify
Expand minified or compressed code — unminify JavaScript, CSS, TypeScript, SCSS, LESS, SQL, YAML and other formats when debugging or reviewing.
Conversion
Transform data between JSON, YAML, XML and CSV locally — no server uploads.
Encoding
Encode or decode Base64, URL components and HTML entities — client-side only.
JSON Tools
Validate, format, diff and explore JSON payloads — complementary to minifiers and converters.
SVG Tools
Preview, optimize with SVGO, export Data URI, resize, beautify, convert to JSX and validate SVG — all in your browser.
Beautify
Make code readable with consistent indentation — beautify JavaScript, CSS, TypeScript, SCSS, LESS, Markdown, GraphQL, SQL, YAML and more in your browser.
CSS preprocessors
Compile SCSS or LESS to standard CSS in the browser — pair with beautify or minify for a full stylesheet workflow.
DevOps & Infra
Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.
CI/CD
GitHub Actions and GitLab CI — format YAML and check workflow/job structure in your browser.
Logs & observability
Line-oriented JSON/NDJSON and Nginx/Apache access logs — format, filter, validate, and CSV/TSV.
Kubernetes
Multi-doc manifests, structural validate, Ingress/Deployment starters, and Helm values formatting.
Networking / IP
CIDR, subnets, and IPv4/IPv6 helpers — in your browser.
Security & tokens
JWKS, X.509 certificates, and secrets scan — browser-local.
API & schemas
OpenAPI tools to format, validate, and lint your specs.
HTTP Tools
Paste-local cURL, HTTP messages, URLs, HAR files, and Cookie / Set-Cookie headers — format and inspect in your browser, never sent.
Developer utilities
Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugify, number bases, case, text diff, and chmod — all client-side.
Text & Markdown
Count words, build Markdown TOCs, and clean line lists — all in your browser.
AI & LLM
Token counting, pricing estimates, and context-window fit — 100% browser-local.
Test Data
Synthetic field values for fixtures and DB seed — reserved-range phone numbers first.