Skip to tool

JavaScript Format number Online

Format number with separators.

The output updates as you type. The tool processes input in your browser.

Worked example

Choose a decimal precision and grouping separators for display. Keep the original numeric value for calculations.

Decimals
2
Decimal point
"."
Thousands separator
","
Sample input
1234567.89
Sample output
1,234,567.89

Using this operation in JavaScript

The interactive result uses JavaScript. JavaScript string indexes count UTF-16 code units. Use code-point iteration when working with supplementary Unicode characters.

JavaScript reference