PHPackages                             rpodwika/network-calculator - 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. rpodwika/network-calculator

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

rpodwika/network-calculator
===========================

Tools to calculate network subnet, prefix, mask, IP range in PHP

0.1.2(10y ago)415MITPHP

Since Jun 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rpodwika/network-calculator)[ Packagist](https://packagist.org/packages/rpodwika/network-calculator)[ RSS](/packages/rpodwika-network-calculator/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

\#Network calculator in PHP

[![Build Status](https://camo.githubusercontent.com/0a3029e450c0533ca4d6a5dffce64cbb7ecbdbc434413bf6b05aff02f5ad368a/68747470733a2f2f7472617669732d63692e6f72672f72706f6477696b612f6e6574776f726b2d63616c63756c61746f722e737667)](https://travis-ci.org/rpodwika/network-calculator)[![Coverage Status](https://camo.githubusercontent.com/2273bd23f6a41371c7c7b111dcac03b3d3ecf71de1e176f2e3f37ca6d4bb812f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72706f6477696b612f6e6574776f726b2d63616c63756c61746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/rpodwika/network-calculator?branch=master)[![Dependency Status](https://camo.githubusercontent.com/f5d729af6b8dd50b87ae5c373858b2288d10a59c26c32bdf23eba59775263828/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537366534356332376263363831303034326266323661612f62616467652e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/user/projects/576e45c27bc6810042bf26aa)[![Latest Stable Version](https://camo.githubusercontent.com/8188288e6fca4ee0178742ba4666f5dac640b58fc2e4355bed5fb0ec49c62d91/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f6e6574776f726b2d63616c63756c61746f722f762f737461626c65)](https://packagist.org/packages/rpodwika/network-calculator) [![Total Downloads](https://camo.githubusercontent.com/45d7cb731355e4c43c0c881449d36b50a8e0cdc0fe6223ee30c61a19d786feb3/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f6e6574776f726b2d63616c63756c61746f722f646f776e6c6f616473)](https://packagist.org/packages/rpodwika/network-calculator) [![Latest Unstable Version](https://camo.githubusercontent.com/20d341134e896fd0f64a07f8e0091fa4942c618384898b986173c4f7948839e8/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f6e6574776f726b2d63616c63756c61746f722f762f756e737461626c65)](https://packagist.org/packages/rpodwika/network-calculator) [![License](https://camo.githubusercontent.com/12f3a168665bddc5f51383052776c2a4fc3dbc08b9ac405a0f289436824c0e19/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f6e6574776f726b2d63616c63756c61746f722f6c6963656e7365)](https://packagist.org/packages/rpodwika/network-calculator)

During searching for good network calculator I couldn't find a good one written in PHP. That's why I've decided to write it using only bitmask operations and math.

\#What can I calculate?

- Network address
- Broadcast address
- CIDR prefix
- First and last IP in the network
- Number of possible hosts in the network

\#How to use?

```
$networkCalculator = new NetworkCalculator("192.168.1.14, "255.255.255.0");

echo $networkCalculator->calculateNetworkAddress(); // 192.168.1.0
echo $networkCalculator->calculateBroadcastIp(); // 192.168.1.255
echo $networkCalculator->calculateNetworkMaskLength(); // 24

list($first, $last) = $networkCalculator->calculateIpRange();

echo $first; // 192.168.1.1
echo $last; // 192.168.1.254

echo $networkCalculator; // will print all the information in pretty way

```

\#Found a bug?

Just make pull request or report issue

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~0 days

Total

3

Last Release

3701d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba61a85f15cc83696965d2d2bcc7e5432d767243b6034c5d8ce91dfbea9d2ce6?d=identicon)[rpodwika](/maintainers/rpodwika)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rpodwika-network-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/rpodwika-network-calculator/health.svg)](https://phpackages.com/packages/rpodwika-network-calculator)
```

###  Alternatives

[clue/graph

GraPHP is the mathematical graph/network library written in PHP.

7154.6M45](/packages/clue-graph)[graphp/algorithms

Common mathematical graph algorithms implemented in PHP

1393.0M14](/packages/graphp-algorithms)[themehybrid/hybrid-mix

Hybrid Mix is a helper class for WordPress plugins and themes using Laravel Mix.

104.5k1](/packages/themehybrid-hybrid-mix)

PHPackages © 2026

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