PHPackages                             innmind/json - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. innmind/json

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

innmind/json
============

Type safe json encoder/decoder

1.5.0(4mo ago)9283.5k↓51.2%215MITPHPPHP ~8.4CI passing

Since May 8Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Innmind/Json)[ Packagist](https://packagist.org/packages/innmind/json)[ Docs](http://github.com/Innmind/Json)[ RSS](/packages/innmind-json/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (2)Dependencies (4)Versions (12)Used By (15)

Json
====

[](#json)

[![Build Status](https://github.com/Innmind/JSON/workflows/CI/badge.svg?branch=master)](https://github.com/Innmind/JSON/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/2d312e8307f5222a4727c8b477058871b46d56104334faf79eef983a982148d6/68747470733a2f2f636f6465636f762e696f2f67682f496e6e6d696e642f4a534f4e2f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Innmind/JSON)[![Type Coverage](https://camo.githubusercontent.com/44d0d43ae934896618665084316c243fb1a644fd1b211d8c7f6b1dadd658594f/68747470733a2f2f73686570686572642e6465762f6769746875622f496e6e6d696e642f4a534f4e2f636f7665726167652e737667)](https://shepherd.dev/github/Innmind/JSON)

Type safe json encode/decoder, the goal is to not leave errors unchecked.

Installation
------------

[](#installation)

```
composer require innmind/json
```

Usage
-----

[](#usage)

```
use Innmind\Json\Json;

Json::encode(['foo' => 'bar']); // {"foo":"bar"}
Json::decode('{"foo":"bar"}'); // ['foo' => 'bar']
Json::decode('{]'); // will throw an exception (instead of returning false)
```

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 91% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~566 days

Recently: every ~657 days

Total

6

Last Release

121d ago

PHP version history (5 changes)1.0.0PHP ~7.2

1.2.0PHP ~7.3

1.3.0PHP ~7.4 || ~8.0

1.4.0PHP ~8.2

1.5.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (71 commits)")[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (3 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (2 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

---

Tags

json

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/innmind-json/health.svg)

```
[![Health](https://phpackages.com/badges/innmind-json/health.svg)](https://phpackages.com/packages/innmind-json)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.7k328.4M734](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k493.5M159](/packages/mtdowling-jmespathphp)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k139.8M905](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.9k91.4M662](/packages/jms-serializer-bundle)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30424.1M51](/packages/colinodell-json5)[clue/ndjson-react

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.

15577.1M25](/packages/clue-ndjson-react)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
