PHPackages                             ppalashturov/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. ppalashturov/number-to-words

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

ppalashturov/number-to-words
============================

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

v0.2(3y ago)015MITPHPPHP &gt;=7.4

Since Mar 3Pushed 3y agoCompare

[ Source](https://github.com/ppalashturov/number-to-words)[ Packagist](https://packagist.org/packages/ppalashturov/number-to-words)[ RSS](/packages/ppalashturov-number-to-words/feed)WikiDiscussions master Synced today

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

PHP Number to words converter
=============================

[](#php-number-to-words-converter)

[![Minimum PHP Version](https://camo.githubusercontent.com/4f9eddea3b5f90bdf4c2f6feafb71962a03512fd923888e4aef358cf6334daf7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![GitHub release](https://camo.githubusercontent.com/99b7b29d3a93d85d0161defc033a416121a780249abf6bdabfe6af23568adc62/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7070616c6173687475726f762f6e756d6265722d746f2d776f726473)](https://github.com/ppalashturov/number-to-words)

This library allows you to convert a number to words.

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

[](#installation)

Add package to your composer.json by running:

```
$ composer require ppalashturov/number-to-words

```

Usage
-----

[](#usage)

This library currently has two types of number-to-words transformations: number and currency. In order to use a specific transformer for certain language you need to create an instance of `NumberToWords` class and then call a method which creates a new instance of a transformer;

### Number Transformer

[](#number-transformer)

Before using a transformer, it must be created:

```
use NumberToWords\NumberToWords;

// create the number to words "manager" class
$numberToWords = new NumberToWords();

// build a new number transformer using the RFC 3066 language identifier
$numberTransformer = $numberToWords->getNumberTransformer('en');
```

Then it can be used passing in numeric values to the `toWords()` method:

```
$numberTransformer->toWords(5120); // outputs "five thousand one hundred twenty"
```

You can also use a static method:

```
NumberToWords::transformNumber('en', 5120); // outputs "five thousand one hundred twenty"
```

### Currency Transformer

[](#currency-transformer)

Creating a currency transformer works just like a number transformer.

```
use NumberToWords\NumberToWords;

// create the number to words "manager" class
$numberToWords = new NumberToWords();

// build a new currency transformer using the RFC 3066 language identifier
$currencyTransformer = $numberToWords->getCurrencyTransformer('en');
```

Then it can be used passing in numeric values for amount and ISO 4217 currency identifier to the `toWords()` method:

```
$currencyTransformer->toWords(5099, 'USD'); // outputs "fifty dollars ninety nine cents"
```

You can also use a static method:

```
NumberToWords::transformCurrency('en', 5099, 'USD'); // outputs "fifty dollars ninety nine cents"
```

Please bear in mind, the currency transformer accepts integers as the amount to transform. It means that if you store amounts as floats (e.g. 4.99) you need to multiply them by 100 and pass the integer (499) as an argument.

Available locale
----------------

[](#available-locale)

LanguageIdentifierNumberCurrencyAlbanianal++Arabicar++Azerbaijaniaz++Belgian Frenchfr\_BE+-Brazilian Portuguesept\_BR++Bulgarianbg++Czechcs+-Danishdk++Dutchnl+-Englishen++Estonianet+-Georgianka++Germande++Frenchfr++Hungarianhu++Indonesianid++Italianit+-Kurdishku+-Lithuanianlt++Latvianlv++Macedonianmk+-Malayms++Persianfa+-Polishpl++Romanianro++Slovaksk++Spanishes++Russianru++Swedishsv+-Turkishtr++Turkmentk++Ukrainianua++Yorubayo++Contributors
------------

[](#contributors)

Many transformers were ported from the `pear/Numbers_Words` library. Some of them were created from scratch by [contributors](https://github.com/ppalashturov/number-to-words/graphs/contributors). Thank you!

Version 2.x - BC and major changes
----------------------------------

[](#version-2x---bc-and-major-changes)

- Dropped support for PHP &lt;7.4.
- Added typehints for `NumberTransformer` and `CurrencyTransformer` interfaces. Now both accept integer numbers only (Albanian language might be affected).
- Added support for PSR12.

Questions and answers
---------------------

[](#questions-and-answers)

**Q: I found a bug. What should I do?**

A: Please report an issue on GitHub. Also feel free to fix it and open a pull request. I don't know most of those languages that the library supports, so your help and contribution would be much appreciated. Thanks!

**Q: My language is missing. Could you add it, please?**

A: Unfortunately, there's a high chance I don't know your language. Feel free to implement the missing transformer and open a pull request. You can take a look at the existing transformers, and follow the same pattern as other languages do.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 74.7% 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

1218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/deac2584dcf400baf2789930b4f3718a7409778c52ed4092d9d056f3b7feb868?d=identicon)[pavel\_wdev](/maintainers/pavel_wdev)

---

Top Contributors

[![kwn](https://avatars.githubusercontent.com/u/3968616?v=4)](https://github.com/kwn "kwn (215 commits)")[![Zehir](https://avatars.githubusercontent.com/u/845225?v=4)](https://github.com/Zehir "Zehir (14 commits)")[![janhartigan](https://avatars.githubusercontent.com/u/580052?v=4)](https://github.com/janhartigan "janhartigan (7 commits)")[![popovserhii](https://avatars.githubusercontent.com/u/1991183?v=4)](https://github.com/popovserhii "popovserhii (5 commits)")[![IgorZavaleev](https://avatars.githubusercontent.com/u/25030672?v=4)](https://github.com/IgorZavaleev "IgorZavaleev (4 commits)")[![ickbinhier](https://avatars.githubusercontent.com/u/2810904?v=4)](https://github.com/ickbinhier "ickbinhier (3 commits)")[![cristiangomeze](https://avatars.githubusercontent.com/u/19762300?v=4)](https://github.com/cristiangomeze "cristiangomeze (3 commits)")[![veguss](https://avatars.githubusercontent.com/u/35691298?v=4)](https://github.com/veguss "veguss (3 commits)")[![shahonseven](https://avatars.githubusercontent.com/u/372461?v=4)](https://github.com/shahonseven "shahonseven (3 commits)")[![goodot](https://avatars.githubusercontent.com/u/10999902?v=4)](https://github.com/goodot "goodot (3 commits)")[![leonardjke](https://avatars.githubusercontent.com/u/22217360?v=4)](https://github.com/leonardjke "leonardjke (2 commits)")[![CreepPork](https://avatars.githubusercontent.com/u/1590711?v=4)](https://github.com/CreepPork "CreepPork (2 commits)")[![iamdual](https://avatars.githubusercontent.com/u/3048763?v=4)](https://github.com/iamdual "iamdual (2 commits)")[![kongulov](https://avatars.githubusercontent.com/u/33090344?v=4)](https://github.com/kongulov "kongulov (2 commits)")[![andreybolonin](https://avatars.githubusercontent.com/u/2576509?v=4)](https://github.com/andreybolonin "andreybolonin (2 commits)")[![ppalashturov](https://avatars.githubusercontent.com/u/10973877?v=4)](https://github.com/ppalashturov "ppalashturov (2 commits)")[![pudovmaxim](https://avatars.githubusercontent.com/u/5713098?v=4)](https://github.com/pudovmaxim "pudovmaxim (2 commits)")[![samnela](https://avatars.githubusercontent.com/u/1852108?v=4)](https://github.com/samnela "samnela (2 commits)")[![olivermbs](https://avatars.githubusercontent.com/u/37539998?v=4)](https://github.com/olivermbs "olivermbs (1 commits)")[![havryshkevych](https://avatars.githubusercontent.com/u/5287063?v=4)](https://github.com/havryshkevych "havryshkevych (1 commits)")

---

Tags

moneycurrencystringwordsnumbersnumbertobulgarian

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4375.4M23](/packages/kwn-number-to-words)[brick/money

Money and currency library

1.9k41.8M157](/packages/brick-money)[florianv/swap

PHP currency conversion library for retrieving exchange rates from 30+ providers, with caching and fallback.

1.3k6.8M23](/packages/florianv-swap)[cknow/laravel-money

Laravel Money

1.0k4.8M31](/packages/cknow-laravel-money)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7865.8M47](/packages/akaunting-laravel-money)[coduo/php-to-string

Simple library that converts PHP value into strings

27013.4M14](/packages/coduo-php-to-string)

PHPackages © 2026

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