JavaScript Math.SQRT1_2 Constant

Beginner
5 min read
Updated: Nov 2026
3 examples
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.

JavaScript
Math.SQRT1_2
UsageWhat 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
JavaScript
Math.SQRT1_2

Parameters

None. Math.SQRT1_2 is a constant (a fixed value), not a function. Do not add parentheses.

Return Value

Return ValueDescription
NumberAbout 0.7071067811865476.

JavaScript Examples

Example 1 — Read the Value of Math.SQRT1_2

No parentheses are needed. Notice the underscore in the name.

JavaScript
console.log(Math.SQRT1_2); // 0.7071067811865476
console.log(Math.SQRT1_2.toFixed(4)); // 0.7071
console.log(typeof Math.SQRT1_2); // number
Try It Yourself

How It Works

  1. Plain property. Math.SQRT1_2 is a value, not a function.
  2. Name. SQRT1_2 means square root of 1 over 2.
  3. Short form. toFixed(4) keeps 4 decimals.
  4. 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.

JavaScript
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
Try It Yourself

How It Works

  1. Square root of half. Math.sqrt(0.5) is about 0.7071.
  2. Equal. The constant and the function give the same number, so we see true.
  3. Times SQRT2. Multiplying by Math.SQRT2 gives about 1.
  4. 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.

JavaScript
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
Try It Yourself

How It Works

  1. 45 degrees. Math.PI / 4 is 45 degrees in radians.
  2. Sine. Math.sin(angle) is about 0.707107.
  3. Cosine. Math.cos(angle) gives the same number.
  4. Constant. Math.SQRT1_2 matches both.

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

It is the square root of 1/2, about 0.7071067811865476.
No. It is a number. Write Math.SQRT1_2 without parentheses.
Yes. They have the same value.
It is about 1 / Math.SQRT2. Multiplying the two gives about 1.
It is the sine and cosine of 45 degrees. It is also used when you scale diagonal movement in games.
All of them. It is part of the first JavaScript standard and works in every browser and in Node.js.

Next: SQRT2

Learn about square root of 2.

SQRT2 tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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