npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

urdu-number-words

v1.0.4

Published

Convert numbers to Urdu words using the South Asian numbering system (لاکھ، کروڑ، ارب). Zero dependencies.

Readme

urdu-number-words

اردو نمبر الفاظ

Convert numbers to Urdu words with Pakistani currency (PKR) support.

Uses the South Asian numbering system — لاکھ، کروڑ، ارب

npm version npm downloads license bundle size TypeScript Publish to npm

Installation · Usage · API · Examples · Contributing


Why This Package?

Pakistan's financial, legal, and business systems require numbers written in Urdu words — from cheque printing to government documents to invoices. Urdu has unique words for every number from 1 to 100 (unlike English where you can combine "twenty" + "one"), and uses the South Asian numbering system (لاکھ، کروڑ، ارب) instead of millions and billions.

No npm package existed that handled this correctly — until now.

Perfect for:

  • 🏦 Cheque printing systems
  • 🧾 Invoices and receipts in Urdu
  • 📄 Legal and government documents
  • 🛒 E-commerce platforms serving Pakistani users
  • 💰 Any financial application needing Urdu amount formatting

Features

  • ✅ Numbers to Urdu words (0 to کھربوں and beyond)
  • ✅ South Asian numbering system (ہزار، لاکھ، کروڑ، ارب، کھرب)
  • ✅ Pakistani Rupee (PKR) currency mode with optional "صرف" suffix
  • ✅ Western to Urdu digit conversion (123 → ۱۲۳)
  • ✅ Ordinal numbers (پہلا، دوسرا، تیسرا)
  • ✅ Negative and decimal number support
  • ✅ TypeScript-first with full type definitions
  • ✅ Zero dependencies
  • ✅ Works in Node.js, browsers, Deno, and Bun

Installation

npm install urdu-number-words
yarn add urdu-number-words
pnpm add urdu-number-words

Usage

Basic Conversion

import { toUrduWords } from 'urdu-number-words';

toUrduWords(0);          // "صفر"
toUrduWords(25);         // "پچیس"
toUrduWords(100);        // "ایک سو"
toUrduWords(1500);       // "ایک ہزار پانچ سو"
toUrduWords(100000);     // "ایک لاکھ"
toUrduWords(4325718);    // "تینتالیس لاکھ پچیس ہزار سات سو اٹھارہ"
toUrduWords(10000000);   // "ایک کروڑ"
toUrduWords(1000000000); // "ایک ارب"
toUrduWords(-42);        // "منفی بیالیس"

Currency Mode (PKR)

import { toUrduWords } from 'urdu-number-words';

toUrduWords(5000, { currency: true });
// "پانچ ہزار روپے"

toUrduWords(1500.75, { currency: true });
// "ایک ہزار پانچ سو روپے اور پچھتر پیسے"

toUrduWords(250000, { currency: true });
// "ڈھائی لاکھ روپے"

// Append "صرف" when appendOnly is true
toUrduWords(5000, { currency: true, appendOnly: true });
// "پانچ ہزار روپے صرف"

Urdu Digits

import { toUrduDigits } from 'urdu-number-words';

toUrduDigits(12345);    // "۱۲۳۴۵"
toUrduDigits(1500.75);  // "۱۵۰۰.۷۵"
toUrduDigits("03001234567"); // "۰۳۰۰۱۲۳۴۵۶۷"

Ordinal Numbers

import { toUrduOrdinal } from 'urdu-number-words';

toUrduOrdinal(1);  // "پہلا"
toUrduOrdinal(2);  // "دوسرا"
toUrduOrdinal(3);  // "تیسرا"
toUrduOrdinal(4);  // "چوتھا"

CommonJS

const { toUrduWords, toUrduDigits, toUrduOrdinal } = require('urdu-number-words');

toUrduWords(786); // "سات سو چھیاسی"

Browser (CDN)

<script src="https://cdn.jsdelivr.net/npm/urdu-number-words/dist/index.min.js"></script>
<script>
  console.log(UrduNumberWords.toUrduWords(786));
  // "سات سو چھیاسی"
</script>

API

toUrduWords(num, options?)

Converts a number to Urdu words.

| Parameter | Type | Description | |-----------|------|-------------| | num | number \| string | The number to convert. Use string for very large numbers. | | options | object | Optional configuration (see below). |

Options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | currency | boolean | false | Enable PKR currency mode. | | currencyName | string | "روپے" | Currency unit name. | | fractionalName | string | "پیسے" | Fractional unit name. | | appendOnly | boolean | false | Append "صرف" at the end in currency mode. |

Returns: string — The Urdu words representation.

toUrduDigits(num)

Converts Western digits (0-9) to Urdu digits (۰-۹).

| Parameter | Type | Description | |-----------|------|-------------| | num | number \| string | The number to convert. |

Returns: string — The number with Urdu digits.

toUrduOrdinal(num)

Converts a number to its Urdu ordinal form.

| Parameter | Type | Description | |-----------|------|-------------| | num | number | The number to convert (1-100). |

Returns: string — The Urdu ordinal word.

Numbering System

This package uses the South Asian numbering system used in Pakistan, India, Bangladesh, and Nepal:

| Value | Urdu | Transliteration | Western Equivalent | |------:|------|----------------|--------------------| | 1 | ایک | ek | one | | 10 | دس | das | ten | | 100 | سو | sau | hundred | | 1,000 | ہزار | hazaar | thousand | | 1,00,000 | لاکھ | lakh | hundred thousand | | 10,00,000 | دس لاکھ | das lakh | million | | 1,00,00,000 | کروڑ | crore | ten million | | 1,00,00,00,000 | ارب | arab | billion | | 1,00,00,00,00,000 | کھرب | kharab | hundred billion |

Real-World Examples

Cheque Printing

const amount = 250750.50;
const inWords = toUrduWords(amount, { currency: true, appendOnly: true });
// "دو لاکھ پچاس ہزار سات سو پچاس روپے اور پچاس پیسے صرف"

const inDigits = toUrduDigits(amount);
// "۲۵۰۷۵۰.۵۰"

Invoice Line Item

function formatUrduAmount(amount: number): string {
  return `${toUrduDigits(amount)} (${toUrduWords(amount, { currency: true })})`;
}

formatUrduAmount(15000);
// "۱۵۰۰۰ (پندرہ ہزار روپے)"

Custom Currency

toUrduWords(1500, {
  currency: true,
  currencyName: "ڈالر",
  fractionalName: "سینٹ",
  appendOnly: true,
});
// "ایک ہزار پانچ سو ڈالر صرف"

Edge Cases Handled

toUrduWords(0);                    // "صفر"
toUrduWords(-1);                   // "منفی ایک"
toUrduWords(0.5, { currency: true }); // "صفر روپے اور پچاس پیسے"
toUrduWords(1000000);              // "دس لاکھ"
toUrduWords("999999999999");       // Handles large numbers via string input

TypeScript Support

Full TypeScript definitions are included out of the box:

import { toUrduWords, toUrduDigits, toUrduOrdinal } from 'urdu-number-words';
import type { UrduNumberOptions } from 'urdu-number-words';

const options: UrduNumberOptions = {
  currency: true,
  appendOnly: true,
};

const result: string = toUrduWords(5000, options);

Contributing

Contributions are welcome! Whether it's fixing an Urdu word, adding features, or improving docs.

# Clone the repo
git clone https://github.com/faakhir-habib/urdu-number-words.git
cd urdu-number-words

# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

Please open an issue first to discuss what you'd like to change.

Related Packages

License

MIT © Faakhir Habib


Made with ❤️ in Pakistan 🇵🇰

If this package helped you, please ⭐ the repo!