PHPackages                             marcellopato/cnpj-cpf-format - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. marcellopato/cnpj-cpf-format

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

marcellopato/cnpj-cpf-format
============================

A simple library for formatting CNPJ and CPF numbers

132PHP

Since Feb 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/marcellopato/CnpjCpfFormat)[ Packagist](https://packagist.org/packages/marcellopato/cnpj-cpf-format)[ RSS](/packages/marcellopato-cnpj-cpf-format/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CNPJ-CPF Format
===============

[](#cnpj-cpf-format)

This is a simple library to format and unformat CNPJ and CPF numbers in PHP.

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

[](#installation)

To install this library, run the following command: `composer require marcellopato/cnpj-cpf-format`

Usage
-----

[](#usage)

Here's an example of how to use this library: `use Marcellopato\CnpjCpfFormat\CnpjCpfFormat;`

```
// Formatting a CNPJ number
$cnpj = '11222333000199';
$formattedCnpj = CnpjCpfFormat::formatCnpj($cnpj);

```

Acknowledgments
---------------

[](#acknowledgments)

This library was made possible with the help of ChatGPT, created by OpenAI.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dd1500a471ef434e858e784941772c283dca6af3bda4e7a3d66c83cf1f9abd7?d=identicon)[marcellopato](/maintainers/marcellopato)

---

Top Contributors

[![marcellopato](https://avatars.githubusercontent.com/u/14094147?v=4)](https://github.com/marcellopato "marcellopato (2 commits)")

### Embed Badge

![Health badge](/badges/marcellopato-cnpj-cpf-format/health.svg)

```
[![Health](https://phpackages.com/badges/marcellopato-cnpj-cpf-format/health.svg)](https://phpackages.com/packages/marcellopato-cnpj-cpf-format)
```

PHPackages © 2026

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