PHPackages                             crisu83/php-conversion - 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. crisu83/php-conversion

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

crisu83/php-conversion
======================

Library for converting units and sizes.

0.5.2(11y ago)133312.9k↑19.7%19[2 PRs](https://github.com/Crisu83/php-conversion/pulls)1Apache-2.0PHPPHP &gt;=5.4

Since Oct 18Pushed 3y ago5 watchersCompare

[ Source](https://github.com/Crisu83/php-conversion)[ Packagist](https://packagist.org/packages/crisu83/php-conversion)[ RSS](/packages/crisu83-php-conversion/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (18)Used By (1)

php-conversion
==============

[](#php-conversion)

[![Build Status](https://camo.githubusercontent.com/06a582fb141b1d629a588cf757f1b1e324ae3f76f23c8499e0cf48bf51e1a80b/68747470733a2f2f7472617669732d63692e6f72672f637269737538332f7068702d636f6e76657273696f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/crisu83/php-conversion)

Library for converting units and sizes in PHP.

Units supported
---------------

[](#units-supported)

- Acceleration
- Angle
- Area
- Digital information
- Electric current
- Frequency
- Fuel consumption
- Length
- Luminous Intensity
- Mass
- Power
- Pressure
- Speed
- Temperature
- Time
- Velocity
- Voltage
- Volume

Sizes supported
---------------

[](#sizes-supported)

- Hat size
- Child shoe size

Number base supported
---------------------

[](#number-base-supported)

- Binary
- Octal
- Decimal
- Hexadecimal

Usage
-----

[](#usage)

Example usage:

```
use Crisu83\Conversion\Quantity\DigitalInformation\DigitalInformation;
use Crisu83\Conversion\Quantity\Length\Length;
use Crisu83\Conversion\NumberBase\NumberBase;
use Crisu83\Conversion\Size\HatSize\HatSize;
use Crisu83\Conversion\Size\ShoeSize\ChildShoeSize;

use Crisu83\Conversion\Quantity\Length\Unit as LengthUnit;
use Crisu83\Conversion\Quantity\DigitalInformation\Unit as DIUnit;
use Crisu83\Conversion\Size\HatSize\System as HatSizeSystem;
use Crisu83\Conversion\Size\ShoeSize\System as ShoeSizeSystem;

require(dirname(__DIR__) . '/vendor/autoload.php');

$length = new Length(1, LengthUnit::METRE);
echo $length . '';
echo $length->add(1, LengthUnit::FOOT) . '';
echo $length->add(5)->sub(2, LengthUnit::FOOT) . '';
echo $length->to(LengthUnit::YARD) . '';

echo '';

$di = new DigitalInformation(1000, DIUnit::MEGABYTE);
echo $di . '';
echo $di->to(DIUnit::BIT)->out(2, '.', '') . '';
echo $di->to(DIUnit::GIGABIT) . '';
echo $di->to(DIUnit::TERABYTE)->out(10) . '';

echo '';

$number = new NumberBase("0xff", NumberBase::HEXADECIMAL);
echo $number . '';
echo $number->to(NumberBase::DECIMAL) . '';
echo $number->to(NumberBase::OCTAL) . '';
echo $number->to(NumberBase::BINARY) . '';

echo '';

$hatSize = new HatSize(40, HatSizeSystem::CENTIMETRE);
echo $hatSize . '';
echo $hatSize->to(HatSizeSystem::AMERICAN) . '';
echo $hatSize->to(HatSizeSystem::BRITISH) . '';
echo $hatSize->to(HatSizeSystem::INCH) . '';

echo '';

$shoeSize = new ChildShoeSize(20, ShoeSizeSystem::EUROPEAN);
echo $shoeSize . '';
echo $shoeSize->to(ShoeSizeSystem::AMERICAN) . '';
echo $shoeSize->to(ShoeSizeSystem::BRITISH) . '';
echo $shoeSize->to(ShoeSizeSystem::INCH) . '';
```

Sample output:

```
1.00 m
1.30 m
5.70 m
6.23 yd

1,000.00 MB
8388629474.89 b
7.81 Gb
0.0009534451 TB

0xff
255
o377
b11111111

40 cm
4 US
4 7/8 UK
15.748 in

20 EUR
4.5 - 5 US
3.5 - 4 UK
4.625 in

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.4% 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 ~16 days

Recently: every ~60 days

Total

16

Last Release

4354d ago

### Community

Maintainers

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

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

---

Top Contributors

[![cniska](https://avatars.githubusercontent.com/u/1044868?v=4)](https://github.com/cniska "cniska (65 commits)")[![ojhaujjwal](https://avatars.githubusercontent.com/u/4995501?v=4)](https://github.com/ojhaujjwal "ojhaujjwal (14 commits)")[![martinlindhe](https://avatars.githubusercontent.com/u/181531?v=4)](https://github.com/martinlindhe "martinlindhe (6 commits)")[![lsv](https://avatars.githubusercontent.com/u/20708?v=4)](https://github.com/lsv "lsv (5 commits)")[![tibee](https://avatars.githubusercontent.com/u/3636947?v=4)](https://github.com/tibee "tibee (2 commits)")[![artissant](https://avatars.githubusercontent.com/u/2280426?v=4)](https://github.com/artissant "artissant (1 commits)")[![allansun](https://avatars.githubusercontent.com/u/20531?v=4)](https://github.com/allansun "allansun (1 commits)")[![alexhelkar](https://avatars.githubusercontent.com/u/1548424?v=4)](https://github.com/alexhelkar "alexhelkar (1 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/crisu83-php-conversion/health.svg)

```
[![Health](https://phpackages.com/badges/crisu83-php-conversion/health.svg)](https://phpackages.com/packages/crisu83-php-conversion)
```

###  Alternatives

[jasonpriem/human-name-parser

Takes human names of arbitrary complexity and various wacky formats and parses them out.

110119.6k](/packages/jasonpriem-human-name-parser)[scotthuangzl/yii2-google-chart

A wraper for google chart

12189.0k2](/packages/scotthuangzl-yii2-google-chart)

PHPackages © 2026

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