Spherical Coordinates Calculator

Convert between Cartesian (x, y, z) and spherical (r, θ, φ) coordinates in either direction, using the standard physics (ISO 80000-2) convention.

Quick Facts

Radial distance
r = √(x² + y² + z²)
Straight-line distance from the origin to the point.
Polar angle
θ = arccos(z / r)
Measured from the positive z-axis; ranges 0° to 180°.
Azimuthal angle
φ = atan2(y, x)
Measured in the xy-plane from the positive x-axis; ranges 0° to 360°.
Back to Cartesian
x = r sinθ cosφ, y = r sinθ sinφ, z = r cosθ
Inverse conversion used when spherical values are the input.

Your Results

Calculated
X Coordinate
-
x = r sinθ cosφ
Y Coordinate
-
y = r sinθ sinφ
Z Coordinate
-
z = r cosθ
Radial Distance (r)
-
r = √(x²+y²+z²)
Polar Angle (θ)
-
θ = arccos(z/r), from +z axis
Azimuthal Angle (φ)
-
φ = atan2(y,x), from +x axis

Ready

Choose a conversion direction, enter coordinates, and press Calculate.

Formula and Method for Spherical Coordinate Conversion

Spherical coordinates describe a point in 3D space using a radial distance and two angles instead of three perpendicular distances. This calculator uses the physics (ISO 80000-2) convention: r is the radial distance from the origin, θ (theta) is the polar angle measured from the positive z-axis (0° to 180°), and φ (phi) is the azimuthal angle measured in the xy-plane from the positive x-axis (0° to 360°). Note that many math textbooks swap θ and φ, so always confirm which convention a formula uses before mixing sources.

Converting Cartesian to spherical coordinates

Given (x, y, z), the radial distance is r = √(x² + y² + z²). The polar angle is θ = arccos(z / r), which is always between 0° and 180°. The azimuthal angle is φ = atan2(y, x); using atan2 instead of a plain arctangent keeps the correct quadrant automatically, and this calculator adds 360° when the result is negative so φ falls in the standard 0°-360° range. At the origin (x = y = z = 0), r = 0 and θ, φ are undefined — the calculator reports them as 0 by convention.

Converting spherical to Cartesian coordinates

Given (r, θ, φ) with θ and φ converted to radians, the Cartesian coordinates are x = r·sin(θ)·cos(φ), y = r·sin(θ)·sin(φ), and z = r·cos(θ). These formulas fall directly out of right-triangle trigonometry: r·sin(θ) is the point's distance from the z-axis (its cylindrical radius), which is then split into x and y components using φ, while r·cos(θ) gives the height along the z-axis.

Common mistakes and real-world applications

  • Mixing conventions: some sources (especially many calculus textbooks) swap θ and φ, using θ for the azimuthal angle and φ for the polar angle — check this before comparing results across sources.
  • Degrees vs. radians: trigonometric functions in most programming languages expect radians; forgetting to convert degrees to radians (or back) is the most common source of wrong answers.
  • Out-of-range θ: the polar angle must stay within 0°-180° (0 to π radians); values outside that range do not correspond to a valid point in this convention.
  • Applications: spherical coordinates are used in physics for gravitational and electric fields, in navigation and astronomy for specifying direction (right ascension/declination, azimuth/elevation), in 3D graphics for camera orbit controls, and in engineering for antenna radiation patterns.

Frequently Asked Questions

What is the difference between spherical and Cartesian coordinates?
Cartesian coordinates (x, y, z) locate a point using three perpendicular distances. Spherical coordinates (r, θ, φ) locate the same point using a radial distance r from the origin, a polar angle θ measured from the positive z-axis, and an azimuthal angle φ measured from the positive x-axis in the xy-plane.
What convention does this calculator use for θ and φ?
This calculator uses the physics (ISO 80000-2) convention: θ is the polar (inclination) angle from the positive z-axis, ranging from 0° to 180°, and φ is the azimuthal angle in the xy-plane from the positive x-axis, ranging from 0° to 360°. Some math textbooks swap these two symbols, so always check which convention a source uses.
How do I convert Cartesian (x, y, z) to spherical (r, θ, φ)?
Compute r = √(x² + y² + z²), θ = arccos(z / r), and φ = atan2(y, x), adding 360° (2π radians) to φ if it comes out negative so it falls in the standard 0°-360° range.
How do I convert spherical (r, θ, φ) back to Cartesian (x, y, z)?
Compute x = r·sin(θ)·cos(φ), y = r·sin(θ)·sin(φ), and z = r·cos(θ), where θ and φ are in radians (convert from degrees first if needed).