# react-number-format

> React component to format number in an input or as a text.

Latest version **5.4.5** (published 2026-03-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-number-format
pnpm add react-number-format
yarn add react-number-format
bun add react-number-format
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.4.5 |
| Published | 2026-03-22 |
| First published | 2016-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 238.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4098 |
| Author | Sudhanshu Yadav |
| Maintainers | sudhanshu |
| Keywords | react-component, react, currency, input, number, number-format, mask |

## Links

- npm: https://www.npmjs.com/package/react-number-format
- Repository: https://github.com/s-yadav/react-number-format
- Homepage: https://s-yadav.github.io/react-number-format/docs/intro
- Issues: https://github.com/s-yadav/react-number-format/issues
- npm.io page: https://npm.io/package/react-number-format

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 5.4.5 (latest) — 2026-03-22
- 5.4.4 — 2025-04-12
- 5.4.3 — 2024-12-25
- 5.4.2 — 2024-09-07
- 5.4.1 — 2024-08-25
- 5.4.0 — 2024-06-01
- 5.3.4 — 2024-03-17
- 5.3.3 — 2024-02-25
- 5.3.2 — 2024-02-25
- 5.3.1 — 2023-09-03
- 5.3.0 — 2023-08-13
- 5.2.2 — 2023-05-20
- 5.2.1 — 2023-05-15
- 5.2.0 — 2023-05-14
- 5.1.4 — 2023-03-05
- … 108 more at https://npm.io/package/react-number-format/versions

## README

# react-number-format

React Number Format is an input-formatter library with a sophisticated and light weight caret engine. It ensures that a user can only enter text that meets specific numeric or string patterns, and formats the input value for display.

### Features

1. Prefix, suffix and thousands separator.
1. Input Masking.
1. Format number in an input or format as a simple text.
1. Custom pattern formatting.
1. Custom formatting handler.
1. Fully customizable

### Demos

See the many DEMO sections in [the documentation](https://s-yadav.github.io/react-number-format/docs/props).

### Install

[![npm](https://img.shields.io/npm/dm/react-number-format.svg)](https://www.npmjs.com/package/react-number-format)

Using `npm`

```
npm install react-number-format
```

Using `yarn`

```
yarn add react-number-format
```

### Documentation

Read the full documentation here
[https://s-yadav.github.io/react-number-format/docs/intro](https://s-yadav.github.io/react-number-format/docs/intro)

#### ES6

Numeric Format

```js
import { NumericFormat } from 'react-number-format';
```

NumericFormat Props: [https://s-yadav.github.io/react-number-format/docs/numeric_format](https://s-yadav.github.io/react-number-format/docs/numeric_format)

Pattern Format

```js
import { PatternFormat } from 'react-number-format';
```

PatternFormat Props: [https://s-yadav.github.io/react-number-format/docs/pattern_format](https://s-yadav.github.io/react-number-format/docs/pattern_format)

### Migrate from v4 to v5

[https://s-yadav.github.io/react-number-format/docs/migration](https://s-yadav.github.io/react-number-format/docs/migration)

### v4 doc

[v4 Docs](https://github.com/s-yadav/react-number-format/blob/master/documentation/v4.md)

### Development

- Clone the repository or download the zip
- `npm i -g yarn` to download Yarn
- `yarn` to install dependencies
- `yarn start` to run example server (<http://localhost:8084/>)
- `yarn test` to test changes
- `yarn build` to bundle files

#### Testing

Test cases are written in jasmine and run by karma

Test files : /test/\*\*/\*.spec.js

To run test : `yarn test`

---
_Source: https://npm.io/package/react-number-format · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
