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

ActiveLibrary

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

Converts number to words in persian

1.2.0(2y ago)148.0kMITPHPPHP ^7.4|^8.0

Since Aug 4Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (6)Used By (0)

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

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/e9409f5bf8dee67c9fdcef76a32b5cc1b8732bed9dbf5a284bc9022692222a0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6a7461626161686e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mojtabaahn/php-persian-number-to-words)[![Total Downloads](https://camo.githubusercontent.com/d88d96e7faffebbd66be5de3c5113680ac3ae39dcc9a2170679634f651f29bb0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f6a7461626161686e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mojtabaahn/php-persian-number-to-words)[![Repo Size](https://camo.githubusercontent.com/7b62242358a6ea48f725424eeb82893701fcd69d9edb5204065eab4575d6e343/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6d6f6a7461626161686e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mojtabaahn/php-persian-number-to-words)[![Repo Size](https://camo.githubusercontent.com/c719e1d244d6323fada741670eb2defe6c057759c08dec694e7a47124c71ab20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f6a7461626161686e2f7068702d7065727369616e2d6e756d6265722d746f2d776f7264733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mojtabaahn/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 mojtabaahn/php-persian-number-to-words
```

Usage
-----

[](#usage)

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

$converter = new MojtabaaHN\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 MojtabaaHN\PersianNumberToWords\Dictionary())
    ->setZero('هیچ')
    ->setNegative('منهای')
    ->setSeparator(' ُ ');

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

$converter = new MojtabaaHN\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

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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 ~288 days

Total

5

Last Release

963d ago

PHP version history (2 changes)1.0.0PHP ^7.4

1.2.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/503256c6913ef8f8cbb2934a1f18d2cdce48818b536c0cb730dbf126c11ce4bc?d=identicon)[mojtabaahn](/maintainers/mojtabaahn)

---

Top Contributors

[![mojtabaahn](https://avatars.githubusercontent.com/u/9845317?v=4)](https://github.com/mojtabaahn "mojtabaahn (7 commits)")[![gladx](https://avatars.githubusercontent.com/u/9036557?v=4)](https://github.com/gladx "gladx (2 commits)")

---

Tags

persiannumbers-to-words

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[sadegh19b/laravel-persian-validation

A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers

18293.8k1](/packages/sadegh19b-laravel-persian-validation)[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)[pishran/laravel-persian-slug

Creates Persian slugs for Eloquent models.

5527.6k1](/packages/pishran-laravel-persian-slug)[iamfarhad/validation

🇮🇷 Complete Laravel Persian validation package - Iranian national ID, mobile numbers, Shamsi dates, IBAN/Sheba, postal codes &amp; more. Modern Laravel 10-12 support with both ValidationRule objects &amp; string-based rules.

2917.3k](/packages/iamfarhad-validation)[eskandari/persianrender

PersianRender,Free persian letter conertor for using in php GD, etc.

2515.2k](/packages/eskandari-persianrender)[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)

PHPackages © 2026

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