A conservative force is a force with the property that the work done in moving a particle between two points is independent of the path taken. Equivalently, if a particle travels in a closed loop, the net work done (the sum of the force acting along the path multiplied by the distance travelled) by a conservative force is zero.
A conservative force is dependent only on the position of the object. If a force is conservative, it is possible to assign a numerical value for the potential at any point. When an object moves from one location to another, the force changes the potential energy of the object by an amount that does not depend on the path taken. Gravity and spring forces are examples of conservative forces.
If a force is not conservative, then defining a scalar potential is not possible, because taking different paths would lead to conflicting potential differences between the start and end points. Nonconservative forces transfer energy from the object in motion (just like conservative force), but they do not transfer this energy back to the potential energy of the system to regain it during reverse motion. Instead, they transfer the energy from the system in an energy form which can not be used by the force to transfer it back to the object in motion. Friction is one such nonconservative force.
Path Independence of Conservative Force
Work done by the gravity in a closed path motion is zero. We can extend this observation to other conservative force systems as well. We imagine a closed path motion. We imagine this closed path motion be divided in two motions between points A and B as diagramed in Fig 1 . Starting from point A to point B and then ending at point A via two work paths named 1 and 2 in the figure. The total work by the conservative force for the round trip is zero:
W=W_{AB1}+W_{BA2}=0.
Let us now change the path for motion from A to B by another path, shown as path 3. Again, the total work by the conservative force for the round trip via new route is zero : W=W_{AB3}+W_{BA2}=0.
Comparing two equations, W_{AB1}=W_{AB3}. This is true for an arbitrary path. Therefore, work done for motion from A to B by conservative force along any paths are equal.
Mathematical Description
A force field F, defined everywhere in space (or within a simplyconnected volume of space), is called a conservative force or conservative vector field if it meets any of these three equivalent conditions:

1.
The curl of F is zero:
$\nabla \times \vec{F} = 0. \,$ 
2.
There is zero net work (W) done by the force when moving a particle through a trajectory that starts and ends in the same place:
$W \equiv \oint_C \vec{F} \cdot \mathrm{d}\vec r = 0.\,$ 
3.
The force can be written as the negative gradient of a potential
$\Phi$ :$\vec{F} = \nabla \Phi. \,$