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)0133↓100%AGPL-3.0-or-laterPHPPHP ^8.4

Since Dec 18Pushed 9mo 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 1mo 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

44

—

FairBetter than 91% of packages

Maintenance57

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

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

386d 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://www.gravatar.com/avatar/fa2d3e2e878f1cf76c71b73e6a9234203aa627a7afeada368993830d92ee1dde?d=identicon)[Simbiat](/maintainers/Simbiat)

---

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

688126.8M194](/packages/react-stream)[lorisleiva/cron-translator

Makes CRON expressions human-readable

3148.5M31](/packages/lorisleiva-cron-translator)[icecave/repr

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

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

Generates human-readable strings for PHP DateTime objects

5791.9k](/packages/danielstjules-php-pretty-datetime)[scheb/tombstone

Dead code detection with tombstones for PHP

282578.2k2](/packages/scheb-tombstone)[danog/phpstruct

PHP implementation of python's struct module.

1110.1k](/packages/danog-phpstruct)

PHPackages © 2026

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