Mathematics · Mathematical Physics

Universal Gravitational Force Calculator

Calculate Newtonian gravitational attraction between two point masses.

Runs locally
Your numbers

Inputs and results stay in this browser. Change one value at a time to explore the relationship.

Your inputCalculatedPassed forward in chains
Gravitational force0.000017
Mass product1,000,000
Distance squared4

Calculation steps

  1. Mass product=1000×1000=1000000.
  2. Distance squared=2²=4.
  3. Force=6.6743e-11×1000000÷4=0.00001668575 N.

Understand Gravitational force

One idea, three depths

Choose how deeply to explain Gravitational force

Gravitational force: Calculate Newtonian gravitational attraction between two point masses.

Age 5Explain it to a 5-year-oldStart with a picture

Imagine using Gravitational force to answer this question: calculate newtonian gravitational attraction between two point masses? Enter First mass m₁, Second mass m₂, Separation r; the calculator shows Gravitational force. For example: Two 1000 kg masses 2 m apart attract with approximately 1.6686×10⁻⁵ N. The answer tells you Gravitational force.

Age 15Explain it to a 15-year-oldConnect it to the formula

Gravity grows with both masses and decreases with the square of their centre-to-centre separation. The rule is F=Gm₁m₂/r². Its input values are First mass m₁ (kg), Second mass m₂ (kg), Separation r (m), and the main result is Gravitational force. For example: Two 1000 kg masses 2 m apart attract with approximately 1.6686×10⁻⁵ N.

CollegeExplain it at college levelState the model precisely

This calculator evaluates the stated gravitational force relation over the valid real-number domain stated below. The implemented relation is F=Gm₁m₂/r², evaluated from First mass m₁ (kg), Second mass m₂ (kg), Separation r (m) to produce Gravitational force. Gravity grows with both masses and decreases with the square of their centre-to-centre separation. Use centre-to-centre distance and SI units when using the displayed gravitational constant.

Inputs and valid domain

  • First mass m₁ must be a finite real number, at least 0 in kg.
  • Second mass m₂ must be a finite real number, at least 0 in kg.
  • Separation r must be a finite real number, at least 0 in m.

Important boundary: Use centre-to-centre distance and SI units when using the displayed gravitational constant.

The formula

F=Gm₁m₂/r²

How the calculator works through it

It substitutes First mass m₁, Second mass m₂, Separation r into the formula and exposes every numerical step above. The main output is Gravitational force, accompanied by Mass product, Distance squared.

Read the result correctly

The Gravitational force is the direct answer to “calculate newtonian gravitational attraction between two point masses.” Read it with the units shown beside the inputs; a sign, angle, percentage or rate changes what the number means.

A worked check

Two 1000 kg masses 2 m apart attract with approximately 1.6686×10⁻⁵ N.

Where this model stops being reliable

Use centre-to-centre distance and SI units when using the displayed gravitational constant.

Learn it by changing one value

Begin with the worked example, then change one value while keeping the others fixed. Compare the new result and calculation steps to identify which part of the formula changed.

Dictionary terms behind this calculator

Before studying the codeWhat you should know firstUse the calculator immediately, or check the foundations before reading the implementation.

These foundations help you understand why Gravitational force works. They never block the calculator, and “optional” means useful context rather than a hidden requirement.

Hard requirements

  • Reading formulas and substituting values

    Gravitational force uses F=Gm₁m₂/r². You need to recognise what each side represents before substituting the stated inputs or rearranging the relationship.

    Review this foundation about 4 min

Strong support

  • Ratios, units and dimensional meaning

    Tracking ratios and units keeps the Gravitational force result physically interpretable instead of merely numerical.

    Review this foundation about 5 min

Optional enrichment

Learn the missing foundationsI already know these — show the code

Mathematics → algorithm → program

Implement this calculation in code

These are direct reference implementations of the calculator's principal relationship and first output. They run locally and include a small known-answer check where the language supports it.

Algorithm

  1. Read First mass m₁, Second mass m₂, Separation r.
  2. Evaluate the principal relationship: F=Gm₁m₂/r².
  3. Return Gravitational force and check the domain conditions described above.
Python
            from math import *

def universal_gravitation(a, b, r) -> float:
    return ((6.6743e-11 * (a * b)) / (r * r))

assert abs(universal_gravitation(1000, 1000, 2) - 0.00001668575) < 1e-6 * max(1.0, abs(0.00001668575))
          
Current calculator valuesUpdates when you change an input above.
              
            
C
            #include <assert.h>
#include <math.h>

double universal_gravitation(double a, double b, double r) {
    return ((6.6743e-11 * (a * b)) / (r * r));
}

int main(void) {
    const double expected = 0.00001668575;
    const double actual = universal_gravitation(1000, 1000, 2);
    assert(fabs(actual - expected) < 1e-6 * fmax(1.0, fabs(expected)));
}
          
Current calculator valuesUpdates when you change an input above.
              
            
C++
            #include <cassert>
#include <cmath>
#include <numbers>

double universal_gravitation(double a, double b, double r) {
    return ((6.6743e-11 * (a * b)) / (r * r));
}

int main() {
    constexpr double expected = 0.00001668575;
    const double actual = universal_gravitation(1000, 1000, 2);
    assert(std::fabs(actual - expected) < 1e-6 * std::fmax(1.0, std::fabs(expected)));
}
          
Current calculator valuesUpdates when you change an input above.
              
            
Linux x86-64 assembly

x86-64 NASM · System V ABI · Linux · SSE2 with libm where required

            ; double universal_gravitation(double a, double b, double r)
; Linux x86-64 NASM · System V ABI · first eight doubles in xmm0–xmm7
global universal_gravitation
section .text

universal_gravitation:
    push rbp
    mov rbp, rsp
    sub rsp, 64
    movsd [rbp-8], xmm0
    movsd [rbp-16], xmm1
    movsd [rbp-24], xmm2
    mov rax, 0x3dd2589effed8acc
    movq xmm0, rax
    movsd [rbp-48], xmm0
    movsd xmm0, [rbp-8]
    mulsd xmm0, [rbp-16]
    movsd [rbp-56], xmm0
    movsd xmm0, [rbp-48]
    mulsd xmm0, [rbp-56]
    movsd [rbp-40], xmm0
    movsd xmm0, [rbp-24]
    mulsd xmm0, [rbp-24]
    movsd [rbp-64], xmm0
    movsd xmm0, [rbp-40]
    divsd xmm0, [rbp-64]
    movsd [rbp-32], xmm0
    movsd xmm0, [rbp-32]
    leave
    ret
          
Current calculator valuesUpdates when you change an input above.
              
            
MATLAB
            function result = universal_gravitation(a, b, r)
    result = ((6.6743e-11 * (a * b)) / (r * r));
end
          
Current calculator valuesUpdates when you change an input above.
              
            
Wolfram Language
            ClearAll[mwCalculate];
mwCalculate[a_, b_, r_] := ((6.6743e-11 * (a * b)) / (r * r));
          
Current calculator valuesUpdates when you change an input above.
              
            

Continue in mathematical software

The downloaded file includes your current inputs and first calculated result. It is created locally.

Floating-point answers can differ slightly by language, compiler and processor. Compare within a suitable tolerance rather than assuming every decimal representation will be identical.

Supporting sourcesAcademic referencesPrimary standards, textbooks and complete citations

Standards, reading and academic references

Use the calculator as the worked interaction, then consult the primary standards and academic textbooks listed below. MW SysArc links to the original sources; the explanation on this page is original and does not reproduce them.

University Physics Volume 3

Read OpenStax University Physics: Quantum Mechanics
Cite this book
APA 7
Ling, S. J., Sanny, J., & Moebs, W. (2016). University physics volume 3. OpenStax. https://openstax.org/books/university-physics-volume-3/pages/1-introduction
MLA 9
Ling, Samuel J., et al. University Physics Volume 3. OpenStax, 2016, https://openstax.org/books/university-physics-volume-3/pages/1-introduction.
Chicago author-date
Ling, Samuel J., Jeff Sanny, and William Moebs. 2016. University Physics Volume 3. Houston, TX: OpenStax. https://openstax.org/books/university-physics-volume-3/pages/1-introduction.

OpenStax entries are free to read online. Follow the licence shown on each linked source before redistributing or adapting its content.

Reuse the page responsiblyCite this pageAPA, MLA, Chicago, Harvard, BibTeX and RIS

These formats cite this calculator page itself. They are separate from the academic references above, which support the mathematical method and terminology.

APA 7

MW SysArc. (2026, July 21). Universal Gravitational Force Calculator. MW SysArc Tools. https://math.mwsysarc.com/mathematical-physics/universal-gravitation

MLA 9

MW SysArc. “Universal Gravitational Force Calculator.” MW SysArc Tools, 21 July 2026, https://math.mwsysarc.com/mathematical-physics/universal-gravitation. Accessed 31 Aug. 2026.

Chicago 17

MW SysArc. “Universal Gravitational Force Calculator.” MW SysArc Tools. Published July 21, 2026. Accessed August 31, 2026. https://math.mwsysarc.com/mathematical-physics/universal-gravitation.

Harvard

MW SysArc (2026) ‘Universal Gravitational Force Calculator’, MW SysArc Tools. Published 21 July 2026. Available at: https://math.mwsysarc.com/mathematical-physics/universal-gravitation (Accessed: 31 August 2026).

BibTeX and RIS records

BibTeX

@misc{mwsysarc_universal_gravitation_2026,
  author = {{MW SysArc}},
  title = {Universal Gravitational Force Calculator},
  howpublished = {MW SysArc Tools},
  year = {2026},
  url = {https://math.mwsysarc.com/mathematical-physics/universal-gravitation},
  note = {Published July 21, 2026; accessed August 31, 2026}
}

RIS

TY  - ELEC
AU  - MW SysArc
TI  - Universal Gravitational Force Calculator
T2  - MW SysArc Tools
PY  - 2026
DA  - 2026-07-21
Y2  - 2026-08-31
UR  - https://math.mwsysarc.com/mathematical-physics/universal-gravitation
N1  - Published July 21, 2026
ER  -

Clear answers

Frequently asked questions

What does the Gravitational force do?

Calculate Newtonian gravitational attraction between two point masses.

How does the Gravitational force work?

The calculator applies F=Gm₁m₂/r². Gravity grows with both masses and decreases with the square of their centre-to-centre separation.

What can I learn from the Gravitational force?

It connects the mathematical rule to your chosen numbers and shows each calculation step. Change one input at a time to see how the result responds.

Does MW SysArc receive or store what I enter?

No. The calculation runs locally in your browser. MW SysArc does not receive or store your calculation inputs.

How should I use the result?

Use the steps to understand the method, then verify important school or professional work using the notation and rounding rules required in your setting.

Last reviewed . Calculations tested .

MW SysArc Certified