This calculator computes the force between a solenoid and another piece of ferromagnetic material separated by a gap of distance g.
F = (Fm)2 μ0 A / (2 g2)
F = (N*I)2 μ0 A / (2 g2),
Where:
Note, any units can be used for A and g so long as they are consistent. For example, in2 and in, or m2 and m, respectively.