PHPackages                             xndbogdan/filesize-conversions - 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. xndbogdan/filesize-conversions

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

xndbogdan/filesize-conversions
==============================

Filesize conversions in PHP

v1.1(3y ago)2517[2 PRs](https://github.com/xndbogdan/filesize-conversions/pulls)MITPHPPHP ^8.0

Since Aug 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xndbogdan/filesize-conversions)[ Packagist](https://packagist.org/packages/xndbogdan/filesize-conversions)[ Docs](https://github.com/xndbogdan/filesize-conversions)[ GitHub Sponsors](https://github.com/xndbogdan)[ RSS](/packages/xndbogdan-filesize-conversions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (7)Used By (0)

[![](https://camo.githubusercontent.com/2bedf63f24cda7efab02da955dc11fb7ef8a060e2f26b73c33a7aac84529b8a3/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31)](https://supportukrainenow.org)

Filesize conversions in PHP
===========================

[](#filesize-conversions-in-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bde0f9cae52987e7a827f19ee73425f9a3e9a9cb039215c3e60a2614c67dd485/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f786e64626f6764616e2f66696c6573697a652d636f6e76657273696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xndbogdan/filesize-conversions)[![Tests](https://github.com/xndbogdan/filesize-conversions/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/xndbogdan/filesize-conversions/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/d2a5f4ec8f49973621f0e8b2e16cf2052af7ade720bcfbe5c4bb6e4afe21df77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f786e64626f6764616e2f66696c6573697a652d636f6e76657273696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xndbogdan/filesize-conversions)

This is a php plugin that lets you convert filesizes. I'm not sure why would anyone need this, but here it is!

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

[](#installation)

You can install the package via composer:

```
composer require xndbogdan/filesize-conversions
```

Usage
-----

[](#usage)

```
FilesizeConversions::fromBytes(pow(1024, 5))->toPetabytes();
```

You can also use this package to get a real file's size and convert it to anything, like this:

```
FilesizeConversions::fromFile($yourFilePath)->toKilobytesHuman();
```

Moreover, you can now do quick conversions

```
FileSizeConversions::quickConvert('megabytes', 'kilobytes', 15);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Bogdan Mihai](https://github.com/xndbogdan)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

4

Last Release

1370d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cbdaaa53950472780bd50b3314c1d8a3ee42f1c1b185c5922f6998e07f16d76b?d=identicon)[xnd\_bogdan](/maintainers/xnd_bogdan)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (90 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (29 commits)")[![xndbogdan](https://avatars.githubusercontent.com/u/27998462?v=4)](https://github.com/xndbogdan "xndbogdan (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (13 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (12 commits)")[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (9 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (7 commits)")[![gregkos](https://avatars.githubusercontent.com/u/6676236?v=4)](https://github.com/gregkos "gregkos (4 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (4 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (3 commits)")[![jamessessford](https://avatars.githubusercontent.com/u/17096446?v=4)](https://github.com/jamessessford "jamessessford (2 commits)")[![erikn69](https://avatars.githubusercontent.com/u/4933954?v=4)](https://github.com/erikn69 "erikn69 (2 commits)")[![koossaayy](https://avatars.githubusercontent.com/u/6431084?v=4)](https://github.com/koossaayy "koossaayy (2 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (2 commits)")[![bvtterfly](https://avatars.githubusercontent.com/u/99682351?v=4)](https://github.com/bvtterfly "bvtterfly (1 commits)")[![dietercoopman](https://avatars.githubusercontent.com/u/4672752?v=4)](https://github.com/dietercoopman "dietercoopman (1 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (1 commits)")[![cmgmyr](https://avatars.githubusercontent.com/u/4693481?v=4)](https://github.com/cmgmyr "cmgmyr (1 commits)")[![weerd](https://avatars.githubusercontent.com/u/105849?v=4)](https://github.com/weerd "weerd (1 commits)")

---

Tags

conversionconversionsconverterfilelaravelpackagephpsizexndbogdanfilesize-conversions

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/xndbogdan-filesize-conversions/health.svg)

```
[![Health](https://phpackages.com/badges/xndbogdan-filesize-conversions/health.svg)](https://phpackages.com/packages/xndbogdan-filesize-conversions)
```

###  Alternatives

[pmill/php-scheduler

Simple PHP task scheduler

1833.5k](/packages/pmill-php-scheduler)[hydreflab/jedi-faker

Faker extension for Star Wars junkie

1429.5k1](/packages/hydreflab-jedi-faker)[yii2mod/yii2-bx-slider

Bx-slider widget based on bx-slider extension {@link http://bxslider.com)

1210.8k](/packages/yii2mod-yii2-bx-slider)

PHPackages © 2026

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