Math.PI Last updated: 30. May 2026

Returns the number PI.

See also: Math.sqrt Math.pow Math.sin

Parameters

This function takes no parameters

Returns

Number (PI)

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
PI is:
#Math.PI#

Output

The #JS code above produces the output shown below:
PI is:
3.141592653589793