PHPackages                             kusabi/tax - 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. kusabi/tax

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

kusabi/tax
==========

A library for calculating tax in PHP

1.0.1(4y ago)03mitPHPPHP &gt;=5.4

Since Nov 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kusabi/tax)[ Packagist](https://packagist.org/packages/kusabi/tax)[ RSS](/packages/kusabi-tax/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

PHP Tax
=======

[](#php-tax)

[![Tests](https://github.com/kusabi/tax/workflows/tests/badge.svg)](https://github.com/kusabi/tax/workflows/tests/badge.svg)[![codecov](https://camo.githubusercontent.com/65f402577f61107c9e7cb7ffb59979c1b2bb6caa555eff5c4d8db1c7d8deb84d/68747470733a2f2f636f6465636f762e696f2f67682f6b75736162692f7461782f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/kusabi/tax)[![Licence Badge](https://camo.githubusercontent.com/e4912c4c7053fb02ca31cc675bc11875aacc2b1dd4dbfb4c45eace5b2457cf95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b75736162692f7461782e737667)](https://img.shields.io/github/license/kusabi/tax.svg)[![Release Badge](https://camo.githubusercontent.com/494791b0c029d496b98671c68e7c039d61966c6a194821b40cb3096466401b31/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b75736162692f7461782e737667)](https://img.shields.io/github/release/kusabi/tax.svg)[![Tag Badge](https://camo.githubusercontent.com/6aa1527e930810452ecbb20f5734dec255a82395c83cc4da19dad46d3a927643/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6b75736162692f7461782e737667)](https://img.shields.io/github/tag/kusabi/tax.svg)[![Issues Badge](https://camo.githubusercontent.com/008711e32c5a77e6c163a1d27129d45f89ba1dfc6f50e5fc866e0d40d21762d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6b75736162692f7461782e737667)](https://img.shields.io/github/issues/kusabi/tax.svg)[![Code Size](https://camo.githubusercontent.com/55218c5cfd78b5a32a6b005030505a405294764603cecec4c05ffc9f3a78a975/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6b75736162692f7461782e7376673f6c6162656c3d73697a65)](https://img.shields.io/github/languages/code-size/kusabi/tax.svg)

A library for calculating tax in PHP

Compatibility and dependencies
------------------------------

[](#compatibility-and-dependencies)

This library is compatible with PHP version `5.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0` and `8.1`.

This library has no dependencies.

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

[](#installation)

Installation is simple using composer.

```
composer require kusabi/tax
```

Or simply add it to your `composer.json` file

```
{
    "require": {
        "kusabi/tax": "^1.0"
    }
}
```

PHPBench Benchmark Results
--------------------------

[](#phpbench-benchmark-results)

Below are the latest benchmark results taken on my local machine for PHP 5.4.

benchmarksubjectmeandiffTaxBenchbenchTaxFromNet1.026μs0.00%TaxBenchbenchGrossFromNet1.053μs+2.58%TaxBenchbenchNetFromTax1.084μs+5.57%TaxBenchbenchGrossFromTax1.086μs+5.77%TaxBenchbenchTaxFromGross1.091μs+6.29%TaxBenchbenchNetFromGross1.098μs+6.94%TaxBenchbenchRateFromNetAndTax1.228μs+19.64%TaxBenchbenchRateFromGrossAndTax1.275μs+24.25%TaxBenchbenchRateFromNetAndGross1.279μs+24.60%Functions
---------

[](#functions)

This library adds a number of functions to calculate tax.

Below you can find links to the documentation for the new features.

FunctionDescription[gross\_from\_net](documentation/gross_from_net.md)Calculate the gross amount from the net amount and tax rate[gross\_from\_tax](documentation/gross_from_tax.md)Calculate the gross amount from the tax amount and tax rate[net\_from\_gross](documentation/net_from_gross.md)Calculate the net amount from the gross amount and tax rate[net\_from\_tax](documentation/net_from_tax.md)Calculate the net amount from the tax amount and tax rate[rate\_from\_gross\_and\_tax](documentation/rate_from_gross_and_tax.md)Calculate the tax rate from the gross amount and tax amount[rate\_from\_net\_and\_gross](documentation/rate_from_net_and_gross.md)Calculate the tax rate from the net amount and gross amount[rate\_from\_net\_and\_tax](documentation/rate_from_net_and_tax.md)Calculate the tax rate from the net amount and tax amount[tax\_from\_gross](documentation/tax_from_gross.md)Calculate the tax amount from the gross amount and tax rate[tax\_from\_net](documentation/tax_from_net.md)Calculate the tax amount from the net amount and tax rate

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~223 days

Total

2

Last Release

1783d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62f4942978644437b5ff3d7bd3f6411580413d327b001104acd4914f43ab63b6?d=identicon)[kusabi](/maintainers/kusabi)

---

Top Contributors

[![kusabi](https://avatars.githubusercontent.com/u/22000941?v=4)](https://github.com/kusabi "kusabi (6 commits)")

---

Tags

phptaxphptax

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/kusabi-tax/health.svg)

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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