Newton’s form of Kepler’s 3rd law describes the orbit of a planet around the Sun. From this law we can calculate the mass of the sun.
P is the orbital period;
G is the gravitation constant;
M is the mass of the Sun;
a is the orbit semi major axis distance.
Rearranging the equation gives:
Now for planet Earth: a = 1.496⋅1011 m
p = 3.154⋅107s
Substitute all the values to the equation and thus gives the mass of the sun M=1.99⋅1030Kg