PHPackages                             simbiat/cute-bytes - 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. simbiat/cute-bytes

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

simbiat/cute-bytes
==================

Class to present bytes in readable format

4.0.1+20250417(1y ago)0289AGPL-3.0-or-laterPHPPHP ^8.4

Since Dec 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Simbiat/cute-bytes)[ Packagist](https://packagist.org/packages/simbiat/cute-bytes)[ Docs](https://github.com/Simbiat/cute-bytes)[ RSS](/packages/simbiat-cute-bytes/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)DependenciesVersions (11)Used By (0)

CuteBytes
=========

[](#cutebytes)

Class to present bytes (numeric value) as a human-readable string. There are several reasons you would want to use this library and not the common one-liner (or 3-liner) approach:

- No missing postfixes in case of too big or too small values.
- No superfluous trailing zeros.
- Follows SI format by default (power of 10 can be switched to power of 2, if so desired).
- Shows thousands by default (adjustable) for extra readability in some cases.

How to use
----------

[](#how-to-use)

Easy:

```
echo \Simbiat\CuteBytes::bytes(1234567890);
```

will output `1,234.57 MB`

You can change decimal and thousands delimiters or change the number of decimals (precision)

```
echo \Simbiat\CuteBytes::bytes(1234567890, decimals: 3, dec_point: ',', thousands_sep: '.');
```

to get `1.234,568 MB`

If you want to drop thousands, set the default number of numbers shown

```
echo \Simbiat\CuteBytes::bytes(1234567890, numbers: 0);
```

to get `1.23 GB`

If you want to use "classic" logic, that is binary, power of 2, use

```
echo \Simbiat\CuteBytes::bytes(1234567890, 1024);
```

to get `1,177.38 MB` (note some additional loss of precision)

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance70

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

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

Recently: every ~230 days

Total

10

Last Release

432d ago

Major Versions

1.1.0+20200905 → 2.0.0+202103102021-03-10

2.0.4+20240407 → 3.0.0+202405022024-05-02

3.0.0+20240502 → 4.0.0+202502092025-02-08

PHP version history (5 changes)1.0.0+20181218PHP &gt;=5.6.0

1.1.0+20200905PHP &gt;=7.4.0

2.0.0+20210310PHP ^8

2.0.4+20240407PHP ^8.3

4.0.1+20250417PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6022665?v=4)[Dmitrii Kustov](/maintainers/Simbiat)[@Simbiat](https://github.com/Simbiat)

---

Top Contributors

[![Simbiat](https://avatars.githubusercontent.com/u/6022665?v=4)](https://github.com/Simbiat "Simbiat (1 commits)")

---

Tags

readablehumanbytescute

### Embed Badge

![Health badge](/badges/simbiat-cute-bytes/health.svg)

```
[![Health](https://phpackages.com/badges/simbiat-cute-bytes/health.svg)](https://phpackages.com/packages/simbiat-cute-bytes)
```

###  Alternatives

[react/stream

Event-driven readable and writable streams for non-blocking I/O in ReactPHP

691139.1M205](/packages/react-stream)[lorisleiva/cron-translator

Makes CRON expressions human-readable

3149.2M37](/packages/lorisleiva-cron-translator)[icecave/repr

A library for generating string representations of any value, inspired by Python's reprlib library.

277.5M4](/packages/icecave-repr)[danielstjules/php-pretty-datetime

Generates human-readable strings for PHP DateTime objects

5797.0k](/packages/danielstjules-php-pretty-datetime)[pharaonic/laravel-readable

Laravel - Readable Number (Integer|decimal) &amp; DateTime &amp; Time Length &amp; File Size.

2280.7k3](/packages/pharaonic-laravel-readable)[danog/phpstruct

PHP implementation of python's struct module.

1110.5k](/packages/danog-phpstruct)

PHPackages © 2026

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