PHPackages                             prfardin/php-persian-number-to-words - 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. prfardin/php-persian-number-to-words

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

prfardin/php-persian-number-to-words
====================================

Converts number to words in persian

v1.0.1(9mo ago)08MITPHPPHP ^7.4|^8.0

Since Jul 30Pushed 9mo agoCompare

[ Source](https://github.com/prfardin/php-persian-number-to-words)[ Packagist](https://packagist.org/packages/prfardin/php-persian-number-to-words)[ Docs](https://github.com/prfardin/php-number-to-words)[ RSS](/packages/prfardin-php-persian-number-to-words/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Convert Numbers to Words In Persian
===================================

[](#convert-numbers-to-words-in-persian)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f2f12acf2050ebef41fd0cf70aa7fed7b32efa92ef3ee3c9d5dbd69a7a567de6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f707266617264696e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/prfardin/php-persian-number-to-words)[![Total Downloads](https://camo.githubusercontent.com/3f751cba163070b7382446535e4cbcd02c24710a106f1940e4ab19c8c36707c9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f707266617264696e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/prfardin/php-persian-number-to-words)[![Repo Size](https://camo.githubusercontent.com/8ef131e1fded051200671674d9cadcef5700221cfd2c3341c43240298d2fc373/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f707266617264696e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/prfardin/php-persian-number-to-words)[![Repo Size](https://camo.githubusercontent.com/253ff160f78336683308a6cefd1e36f353989008e3b80e0cb555dec04a61e2a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f707266617264696e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/prfardin/php-persian-number-to-words)

This packages offers ability to convert numbers to words in persian. Words and phrases are fully configurable, so it is possible to use it for all persian language family with configuration.

Requirement
-----------

[](#requirement)

This package requires **PHP 7.4** or higher.

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

[](#installation)

You can install the package via composer:

```
composer require prfardin/php-persian-number-to-words
```

Usage
-----

[](#usage)

```
$dictionary = new prfardin\PersianNumberToWords\Dictionary();

$converter = new prfardin\PersianNumberToWords\PersianNumberToWords($dictionary);

echo $converter->convert(0);
// صفر

echo $converter->convert(-10);
// منفی ده

echo $converter->convert(229);
// دویست و بیست و نه

echo $converter->convert(999999999);
// نهصد و نود و نه میلیون و نهصد و نود و نه هزار و نهصد و نود و نه
```

Configuration
-------------

[](#configuration)

It is possible to customize the way output should look like using Dictionary class setter methods.

```
$dictionary = (new prfardin\PersianNumberToWords\Dictionary())
    ->setZero('هیچ')
    ->setNegative('منهای')
    ->setSeparator(' ُ ');

// Also ->setUnits(array $units) & -> setSuffixes(array $suffixes) are availabe

$converter = new prfardin\PersianNumberToWords\PersianNumberToWords($dictionary);

echo $converter->convert(0);
// هیچ

echo $converter->convert(-10);
// منهای ده

echo $converter->convert(229);
// دویست ُ بیست ُ نه
```

Default Configuration
---------------------

[](#default-configuration)

This code is a part of Dictionary class, you can see all default Configuration:

```
class Dictionary
{

    protected string $zero = 'صفر';

    protected string $negative = 'منفی';

    protected string $separator = " و ";

    protected array $units = [
        1 => 'یک',
        2 => 'دو',
        3 => 'سه',
        4 => 'چهار',
        5 => 'پنج',
        6 => 'شش',
        7 => 'هفت',
        8 => 'هشت',
        9 => 'نه',
        10 => 'ده',
        11 => 'یازده',
        12 => 'دوازده',
        13 => 'سیزده',
        14 => 'چهارده',
        15 => 'پانزده',
        16 => 'شانزده',
        17 => 'هفده',
        18 => 'هجده',
        19 => 'نوزده',
        20 => 'بیست',
        30 => 'سی',
        40 => 'چهل',
        50 => 'پنجاه',
        60 => 'شصت',
        70 => 'هفتاد',
        80 => 'هشتاد',
        90 => 'نود',
        100 => 'صد',
        200 => 'دویست',
        300 => 'سیصد',
        400 => 'چهارصد',
        500 => 'پانصد',
        600 => 'ششصد',
        700 => 'هفتصد',
        800 => 'هشتصد',
        900 => 'نهصد'
    ];

    protected array $suffixes = [
        3 => 'هزار',
        6 => 'میلیون',
        9 => 'میلیارد',
        12 => 'بیلیون',
        15 => 'بیلیارد',
        18 => 'تریلیون',
        21 => 'تریلیارد',
        24 => 'کوآدریلیون',
        27 => 'کادریلیارد',
        30 => 'کوینتیلیون',
        33 => 'کوانتینیارد',
        36 => 'سکستیلیون',
        39 => 'سکستیلیارد',
        42 => 'سپتیلیون',
        45 => 'سپتیلیارد',
        48 => 'اکتیلیون',
        51 => 'اکتیلیارد',
        54 => 'نانیلیون',
        57 => 'نانیلیارد',
        60 => 'دسیلیون',
        63 => 'دسیلیارد',
    ];

    // Setters & Helpers...

}
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance57

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

Total

2

Last Release

287d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

persiannumbers-to-words

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/prfardin-php-persian-number-to-words/health.svg)

```
[![Health](https://phpackages.com/badges/prfardin-php-persian-number-to-words/health.svg)](https://phpackages.com/packages/prfardin-php-persian-number-to-words)
```

###  Alternatives

[fisharebest/ext-calendar

Implementation of the Arabic (Hijri), French, Gregorian, Jewish, Julian and Persian (Jalali) calendars. Also provides a replacement for the PHP ext/calendar extension.

36473.2k8](/packages/fisharebest-ext-calendar)[opilo/farsi

Farsi Tools for Dates and Numbers and Strings (with Laravel Validation Support)

333.2k1](/packages/opilo-farsi)[pishran/laravel-persian-string

Convert Arabic/English/etc numbers and characters to Persian numbers and characters in Laravel models.

206.7k](/packages/pishran-laravel-persian-string)[aloko/nova-persian-datepicker

Persian Datepicker for Laravel Nova.

203.5k](/packages/aloko-nova-persian-datepicker)[symfony_persia/symfonyjdate

Jalali (Shamsi) DateTime for Symfony2, Supports year higher than 2038

1010.6k](/packages/symfony-persia-symfonyjdate)

PHPackages © 2026

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