Skip to content

urdu-text-utilsThe Urdu Text Processing Toolkit for JavaScript & TypeScript

A lightweight, zero-dependency Urdu NLP and text processing library. Unicode normalization, Roman Urdu transliteration, stop words, digits, diacritics, collation, search and stats.

VitePress renders a string icon with v-html, so inline SVG works and themes

itself through currentColor. Emoji were the alternative, but the digits icon

has no emoji and rendered as a missing-glyph box.

features:

  • icon: | title: Unicode that actually matches details: Folds Arabic ي ك ه to Urdu ی ک ہ, applies NFKC, strips tatweel and bidi controls. Text from Arabic keyboards and legacy CMSes stops failing equality checks. link: /guide/normalization linkText: Normalization
  • icon: | title: Search that ignores diacritics details: محمد matches مُحَمَّد and Arabic-spelled محمد. Optional fuzzy matching, ranked results, and highlighting that keeps the original spelling intact. link: /guide/search linkText: Search
  • icon: | title: Real Urdu collation details: An explicit ا آ ب پ ت ٹ alphabet table, because Intl.Collator("ur") falls back to Arabic root collation and misorders ک گ ٹ ڈ ڑ ں ے. link: /guide/sorting linkText: Sorting
  • icon: | title: Both digit systems details: Urdu digits ۴۵۶ (U+06F0) and Arabic-Indic ٤٥٦ (U+0660) live in different Unicode blocks — four, five and six are where the two sets visibly diverge. Convert either way, parse the Urdu decimal and thousands separators, spell numbers with lakh and crore. link: /guide/numbers linkText: Numbers
  • icon: | title: Statistics for editors details: Words, sentences, paragraphs, diacritic and digit counts, script percentage and reading time — the numbers a CMS word-count widget needs. link: /guide/statistics linkText: Statistics
  • icon: | title: Zero dependencies details: About 11 kB min+gzip, pure and synchronous, side-effect free and tree-shakeable. Ships ESM, CJS and its own type declarations. Published with provenance. link: /guide/getting-started linkText: Install

Try it

normalizeUrdu(text)
Input
Output
کیا حال ہے

Released under the MIT License.