coderef

Numeric separatorsBaseline · Widely available

To improve readability for numeric literals, underscores (_) can be used as separators. For example, 1_050.95 is equivalent to 1050.95.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 28, 2020. Widely available since Jan 28, 2023.

Browser support

DesktopChrome
1–74Not supported
75+Supportedsince Jun 4, 2019
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–69Not supported
70+Supportedsince Oct 22, 2019
Current: 157
Safari
1–12.1Not supported
13+Supportedsince Sep 19, 2019
Current: 27
MobileChrome Android
18–74Not supported
75+Supportedsince Jun 4, 2019
Current: 155
Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157
Safari iOS
1–12.2Not supported
13+Supportedsince Sep 19, 2019
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Lexical grammar#numeric separators.

Feature detection

JS · check before using
// Syntax can't be tested with an if-statement — an unsupported
// browser fails to parse the whole script. Either transpile for older
// targets (e.g. Babel/TypeScript/esbuild), or probe in isolation:
let supported = true;
try {
  new Function("/* code that uses the syntax */");
} catch {
  supported = false;
}

This is a language syntax feature.