Description
React Number Format is a React library for formatting numbers in an input field or as plain display text. It keeps the user to input that matches a numeric or string pattern, and it formats the value as the user types, using a caret engine that keeps the cursor in the right place. The library offers two main components. NumericFormat handles numbers, with options for prefixes, suffixes and a thousands separator, while PatternFormat applies a custom input mask such as a phone number or an ID. For display only, the same components can format a number as text without an input. You can also write a custom formatting handler and customize the rest of the behavior through props. The documentation has a Props reference, a Migration guide and a notes section on quirks, plus demos for each feature. Install it with npm install react-number-format or yarn add react-number-format, and import NumericFormat or PatternFormat from the package.…
Highlights
- Formats numbers in an input as the user types
- Prefix, suffix and thousands separator support
- Pattern input masks with PatternFormat
- Plain text formatting for display with the same components
Ratings & Reviews
No ratings yet
Be the first to rate react-number-format.
People also visit

react-code-input
React component for entering and validating numbers, text or password
react-number-format FAQ
What does React Number Format do?
It formats numbers in a text input as the user types, or formats a number as display text, and keeps the input to the allowed pattern.
What components does it provide?
NumericFormat for numbers and PatternFormat for custom patterns such as masks.
Can I add a prefix or a thousands separator?
Yes. Prefix, suffix and thousands separator are supported as props.
How do I install it?
Run npm install react-number-format or yarn add react-number-format.
Is there a migration guide?
Yes. The documentation includes a migration guide and a page of notes and quirks.
What are the best react-number-format alternatives?
Popular alternatives to react-number-format include @react-input/mask, react-currency-format and react-currency-input. See all react-number-format alternatives



















