JavaScript Math.asin() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Math

Definition

Math.asin(x) returns the arc sine (inverse sine) of a number. It answers: which angle has this sine? The angle is in radians, from -π/2 to π/2.

Math is built into JavaScript. Call the method directly. It is not a constructor, so never write new Math().

Syntax

Call Math.asin() like this. Start with this line.

JavaScript
Math.asin(x)
CallWhat it does
Math.asin(x)Returns the arc sine of x, in radians.

Built into JavaScript. Call Math.asin() on the Math object — no import required.

Library declarations
JavaScript
Math.asin(x)
JavaScript
interface Math {
  asin(x: number): number;
}

Parameters

ParameterDescription
xRequired. A number from -1 to 1. Numbers outside this range return NaN.

Return Value

Return ValueDescription
numberThe angle in radians, from -π/2 to π/2. Returns NaN if x is below -1 or above 1.

JavaScript Examples

Example 1 — Basic Use

Pass a number from -1 to 1. You get an angle in radians.

JavaScript
console.log(Math.asin(0));    // 0
console.log(Math.asin(0.5));  // 0.5235987755982989
console.log(Math.asin(1));    // 1.5707963267948966
console.log(Math.asin(-1));   // -1.5707963267948966
console.log(Math.asin(2));    // NaN
Try It Yourself

How It Works

  1. Sine 0. The angle with sine 0 is 0.
  2. Sine 1. Math.asin(1) is about 1.5708, which is π / 2 (90 degrees).
  3. Negative input. -1 gives -π / 2, a negative angle.
  4. Out of range. 2 is not a valid sine, so you get NaN.

Example 2 — Radians to Degrees

Convert the radians result to degrees with a small helper.

JavaScript
function toDegrees(radians) {
  return radians * 180 / Math.PI;
}

var angle = Math.asin(0.5);
console.log(angle);                        // 0.5235987755982989
console.log(toDegrees(angle).toFixed(1));  // 30.0
console.log(toDegrees(Math.asin(1)));      // 90
Try It Yourself

How It Works

  1. Get radians. Math.asin(0.5) is about 0.5236 radians.
  2. Convert. radians * 180 / Math.PI gives degrees.
  3. Round. toFixed(1) shows a clean 30.0.

Example 3 — Angle in a Right Triangle

The sine is the opposite side divided by the hypotenuse. Use Math.asin() to find the angle.

JavaScript
var opposite = 5;
var hypotenuse = 10;

var ratio = opposite / hypotenuse;
var radians = Math.asin(ratio);
var degrees = radians * 180 / Math.PI;

console.log(ratio);               // 0.5
console.log(degrees.toFixed(1));  // 30.0
Try It Yourself

How It Works

  1. Make the ratio. 5 / 10 is 0.5. This is the sine of the angle.
  2. Apply asin. Math.asin(0.5) returns the angle in radians.
  3. Convert. The angle is 30 degrees.

Browser & Runtime Support

Math.asin() has been part of JavaScript since ES1 and is Baseline Widely available everywhere.

✓ Baseline · ES1

Math.asin()

Supported in every browser and Node.js version. No polyfill is needed.

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.asin Excellent

Bottom line: Use Math.asin() freely. It works in all browsers and runtimes.

Frequently Asked Questions

Math.asin(x) returns the angle, in radians, whose sine is x. For example, Math.asin(1) is about 1.5708, which is 90 degrees.
No. It returns radians. Multiply by 180 / Math.PI to convert to degrees.
A sine is always between -1 and 1, so no angle has a sine of 2. The result is NaN.
The result is between -Math.PI / 2 and Math.PI / 2 (about -1.5708 to 1.5708).
Math.sin(angle) takes an angle and returns a ratio. Math.asin(ratio) takes a ratio and returns the angle.

Next: asinh()

Learn how to find the inverse hyperbolic sine.

asinh() 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.

11 people found this page helpful