The relationship between force and extension is a linear one, which means that if you plot a force vs. extension graph, you'll get a straight line. It will pass through the origin (x = 0; F = 0), and its slope will be equal to the spring constant, k.
Measure the Slope of the Force Extension Graph
In general, you can find the slope of a line by choosing two points and forming a ratio of the rise and the run between these two points. If the first point you choose is (x1, F1), and the second point is (x2, F2), the slope of the line is:
slope= f(2)- f(1)
---------
x(2)-x(1)
Assuming F2 is larger than F1.
This is the value of the spring constant, k. Despite the minus sign in the Hooke's law equation, k is a positive number, because the slope in the Hooke's law graph is positive.
Note that the spring constant has units of force/distance. In the MKS system, the spring constant units are newtons/meter. In the CGS system, they are dynes/centimeter. In the imperial system, they are pounds of force (lbf) /foot.
Now that you have the spring constant, you can predict exactly how much the spring will distend or compress when you subject it to any force.