Home JavaScript Math Methods SQRT1_2 JavaScript Math.SQRT1_2 Constant Definition Math.SQRT1_2 is a built-in constant that holds the square root of 1/2, about 0.7071067811865476. It is the same as 1 / Math.SQRT2. You read it as a property. You do not call it.
Read the value, use it in your math, and check the examples below for common patterns.
Syntax Read the constant. Start with this line.
Usage What it does Math.SQRT1_2Read the square root of 1/2.
Built into JavaScript. Read Math.SQRT1_2 directly from the Math object — no parentheses and no import required.
Library declarations Parameters None. Math.SQRT1_2 is a constant (a fixed value), not a function. Do not add parentheses.
Return Value Return Value Description Number About 0.7071067811865476.
JavaScript Examples 1. Read the value 2. Same as sqrt(0.5) 3. 45 degrees Example 1 — Read the Value of Math.SQRT1_2 No parentheses are needed. Notice the underscore in the name.
console.log(Math.SQRT1_2); // 0.7071067811865476
console.log(Math.SQRT1_2.toFixed(4)); // 0.7071
console.log(typeof Math.SQRT1_2); // number 0.7071067811865476
0.7071
number How It Works Plain property. Math.SQRT1_2 is a value, not a function.Name. SQRT1_2 means square root of 1 over 2.Short form. toFixed(4) keeps 4 decimals.Type. typeof says it is a number.Example 2 — Compare with Math.sqrt(0.5) The constant holds the same number you get from taking the square root of 0.5.
console.log(Math.sqrt(0.5)); // 0.7071067811865476
console.log(Math.SQRT1_2 === Math.sqrt(0.5)); // true
console.log((Math.SQRT1_2 * Math.SQRT2).toFixed(4)); // 1.0000 0.7071067811865476
true
1.0000 How It Works Square root of half. Math.sqrt(0.5) is about 0.7071.Equal. The constant and the function give the same number, so we see true.Times SQRT2. Multiplying by Math.SQRT2 gives about 1.Why have it? A ready-made constant is quick to read and easy to remember.Example 3 — Sine of 45 Degrees At 45 degrees, sine and cosine are both about 0.7071. Compare them with the constant.
const angle = Math.PI / 4;
console.log(Math.sin(angle).toFixed(6)); // 0.707107
console.log(Math.cos(angle).toFixed(6)); // 0.707107
console.log(Math.SQRT1_2.toFixed(6)); // 0.707107 0.707107
0.707107
0.707107 How It Works 45 degrees. Math.PI / 4 is 45 degrees in radians.Sine. Math.sin(angle) is about 0.707107.Cosine. Math.cos(angle) gives the same number.Constant. Math.SQRT1_2 matches both.Compatibility
Browser & Runtime Support Math.SQRT1_2 is part of the first JavaScript standard (ES1 ) and is Baseline Widely available in every browser and in Node.js.
✓ Baseline · ES1
Math.SQRT1_2 A long-standing constant. It works in Chrome, Firefox, Safari, Edge, Internet Explorer and Node.js.
99% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support Math.SQRT1_2 Excellent
Bottom line: Use Math.SQRT1_2 anywhere. It works in all browsers.
Frequently Asked Questions What is Math.SQRT1_2? It is the square root of 1/2, about 0.7071067811865476.
Do I call Math.SQRT1_2 as a function? No. It is a number. Write Math.SQRT1_2 without parentheses.
Is Math.SQRT1_2 the same as Math.sqrt(0.5)? Yes. They have the same value.
How is Math.SQRT1_2 related to Math.SQRT2? It is about 1 / Math.SQRT2. Multiplying the two gives about 1.
Where is 0.7071 useful? It is the sine and cosine of 45 degrees. It is also used when you scale diagonal movement in games.
Which browsers support Math.SQRT1_2? All of them. It is part of the first JavaScript standard and works in every browser and in Node.js.
About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
9 people found this page helpful
Helpful Share Copy link Suggestion