JavaScript (ES2026) reference · Math Methods and Constants

JavaScript Math.PI Property

The ratio of a circle's circumference to its diameter, approximately 3.14159.

JavaScript (ES2026) Since ES1

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

Math.PI

Return value

3.141592653589793

Examples

The valueTry it yourself
console.log(Math.PI);

Output

3.141592653589793
Circle area and circumferenceTry it yourself
const r = 2;
console.log((Math.PI * r ** 2).toFixed(2), (2 * Math.PI * r).toFixed(2));

Output

12.57 12.57

Version history

VersionChange
JavaScript ES1Added

Was this page helpful?