Hiprup

What are numeric separators?

Numeric separators let you put underscores in number literals to make large numbers readable.

  • Readability — 1_000_000 is easier to read than 1000000.

  • No effect on value — the underscores are ignored by the engine.

Purely cosmetic for source code — great for big constants, prices, or bitmasks.

// Without separators (hard to read)
const billion = 1000000000;
const bytes = 0xFFFFFFFF;

// With separators (readable)
const billion2 = 1_000_000_000;
const bytes2 = 0xFF_FF_FF_FF;
const binary = 0b1010_0001_1000_0101;
const price = 1_234.56;
const bigNum = 9_007_199_254_740_991n;

console.log(billion === billion2); // true (same value)

Underscores are visual-only — they do not affect the value. 1_000_000 === 1000000. Works in all numeric literal formats.

ES2021 feature — supported in all modern browsers and Node.js 12.5+.

Simple but shows you know modern JS features. 1_000_000 is much more readable than 1000000. Works with hex, binary, BigInt too.

The underscore is purely cosmetic (ignored by the engine).

What are numeric separators? | Hiprup