Hooke’s law states that the length of extension or compression of the spring is done by the force directly proportional to it.

Hooke’s Law was discovered by the scientist Robert Hooke in the year 1660.
Hooke’s law is only valid within material’s elastic limit.
When the force F is applied on the spring, then the length of the spring is deformed by magnitude x.

F = -kx
F = Spring force.
K = Spring Constant.
x = Length of extends or compress of spring.
F equal to minus k times x.
where, F is spring force.
k is spring constant.
x is length of extends or compress of spring.