HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Chrome 5 runs
toFixed
16.0M/s
string split & reduce
6.5M/s
numberWithCommas
3.1M/s
bignumber
1.8M/s
toLocaleString
81K/s
Intl.NumberFormat
76K/s

Fastest: toFixed (210.6x faster)

View exact numbers
  • toFixed: 15,982,369 ops/sec
  • string split & reduce: 6,489,958 ops/sec
  • numberWithCommas: 3,050,792 ops/sec
  • bignumber: 1,760,352 ops/sec
  • toLocaleString: 80,671 ops/sec
  • Intl.NumberFormat: 75,876 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    toLocaleString
    Intl.NumberFormat
    string split & reduce
    toFixed
    bignumber
    numberWithCommas

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 Edg/135.0.0.0
Chrome 135 on Windows
View result in a separate tab
toFixed
16.0M/s
string split & reduce
6.5M/s
numberWithCommas
3.1M/s
bignumber
1.4M/s
toLocaleString
65K/s
Intl.NumberFormat
63K/s
View exact numbers
Test name Executions per second
toFixed 15,982,369 Ops/sec
string split & reduce 6,489,958 Ops/sec
numberWithCommas 3,050,792 Ops/sec
bignumber 1,369,880 Ops/sec
toLocaleString 65,074 Ops/sec
Intl.NumberFormat 62,802 Ops/sec