Number Formatter

Format a number with grouping, fixed or significant precision and scientific notation.

  • Runs locally in your browser
  • No upload required

Try it

Formatted
1,234,567.89
Style
grouped
Formula
1234567.891 → 1,234,567.89

Supported formats

Input
number, select, text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

1234567.891 formatted as grouped is "1,234,567.89".

How it works

  • Read the value and the requested grouped style.
  • Applied the style's rule (grouping, precision, notation, ordinal suffix or compact unit).
  • Produced a locale-independent, byte-stable string.
textSelect to copy
1234567.891 → 1,234,567.89
  • Formatting never changes the numeric value, only how it is written.

Methodology

  1. Select the formatting rule for the requested style.
  2. For grouped output, insert the chosen separator every three integer digits.
  3. For engineering output, normalise the exponent to the nearest lower multiple of three and scale the mantissa.
  4. For ordinal output, append the English suffix (st, nd, rd, th) using the 11–13 exception.
  5. For compact output, divide by the largest SI-style power of 1000 and append its letter.

Usage

  1. Enter the number to format.
  2. Choose the formatting style.
  3. Set the decimal places or significant figures, and the grouping separator where relevant.
  4. Read the formatted string.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Group with two decimals

jsonSelect to copy
{
  "value": 1234567.891,
  "style": "grouped",
  "decimals": 2
}

Significant figures

jsonSelect to copy
{
  "value": 3.14159,
  "style": "significant",
  "decimals": 4
}

Scientific notation

jsonSelect to copy
{
  "value": 0.0001234,
  "style": "scientific",
  "decimals": 3
}

Compact abbreviation

jsonSelect to copy
{
  "value": 1234567,
  "style": "compact",
  "decimals": 1
}

English ordinal

jsonSelect to copy
{
  "value": 42,
  "style": "ordinal"
}

Limitations

Presentation, not rounding of the value

Formatting changes how many digits are shown and how they are grouped or abbreviated; it does not change the underlying number. A value formatted with two decimals is still the same value.

Because locale-aware formatting varies with the runtime's ICU data, this tool implements the formatting rules directly so identical input always produces identical output.

Frequently asked questions

What is the difference between fixed decimals and significant figures?
Fixed decimals always show a set number of digits after the point (1.20 has two); significant figures count total meaningful digits (1.20 has three). The significant style is better for measurement precision.
How does engineering notation differ from scientific?
Scientific notation uses any exponent; engineering notation constrains the exponent to a multiple of three, matching SI prefixes such as k, M and G.
Why is the output not localised?
Localised formatting depends on the runtime's locale data and would make the result non-deterministic. This tool lets you pick the separator and keeps the decimal point fixed so the output is stable and testable.

Sources

  1. ECMAScript Language Specification — Number.prototype.toFixed / toExponential / toPrecision — Ecma International
  2. MDN Web Docs — Number.prototype.toFixed() — MDN
  3. MDN Web Docs — Number.prototype.toExponential() — MDN