PHPackages                             rych/bytesize - 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. rych/bytesize

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

rych/bytesize
=============

Utility component for nicely formatted file sizes

v1.0.0(12y ago)31219.6k—4.8%111MITPHPPHP &gt;=5.3.4

Since Apr 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rchouinard/bytesize)[ Packagist](https://packagist.org/packages/rych/bytesize)[ Docs](https://github.com/rchouinard/bytesize)[ RSS](/packages/rych-bytesize/feed)WikiDiscussions master Synced 1mo ago

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

ByteSize: File Size Formatter for PHP
=====================================

[](#bytesize-file-size-formatter-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b4c78f477a7b578ce51ed6335c8025b70048681ed4d58ede40c4442981dabd9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f727963682f6279746573697a652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rych/bytesize)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/bdf908c9237c30804a393f55c33638bf5fae7e15dd0e770442cf65514af666ca/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7263686f75696e6172642f6279746573697a652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rchouinard/bytesize)[![Quality Score](https://camo.githubusercontent.com/d35700d8866ff98c3ff78e10f6ca1dfd19078f63ef77572b45169598ca5edecf/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f30366564306263662d383431352d346431652d393830382d3039633035653833323331382e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/06ed0bcf-8415-4d1e-9808-09c05e832318)[![Total Downloads](https://camo.githubusercontent.com/9de35415149b4a3aeebcc3dd9bceb088b0b078db9ec72e16fc70633017f41500/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f727963682f6279746573697a652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rych/bytesize)

ByteSize is a utility component for formatting file sizes in various formats.

Requirements
------------

[](#requirements)

- PHP 5.3+
- BCMath extension

Install
-------

[](#install)

Via Composer

```
$ composer require rych/bytesize
```

Usage
-----

[](#usage)

Basic usage is very simple. Create an instance of `Rych\ByteSize\ByteSize` and call its `format()` method.

```
