Number Formatter
Format a number with grouping, fixed or significant precision and scientific notation.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
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.
1234567.891 → 1,234,567.89- Formatting never changes the numeric value, only how it is written.
Methodology
- Select the formatting rule for the requested style.
- For grouped output, insert the chosen separator every three integer digits.
- For engineering output, normalise the exponent to the nearest lower multiple of three and scale the mantissa.
- For ordinal output, append the English suffix (st, nd, rd, th) using the 11–13 exception.
- For compact output, divide by the largest SI-style power of 1000 and append its letter.
Usage
- Enter the number to format.
- Choose the formatting style.
- Set the decimal places or significant figures, and the grouping separator where relevant.
- 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
{
"value": 1234567.891,
"style": "grouped",
"decimals": 2
}Significant figures
{
"value": 3.14159,
"style": "significant",
"decimals": 4
}Scientific notation
{
"value": 0.0001234,
"style": "scientific",
"decimals": 3
}Compact abbreviation
{
"value": 1234567,
"style": "compact",
"decimals": 1
}English ordinal
{
"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
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.