The magnitude of the force is given by F = BILsin(θ) . I is the current flowing through the wire, L is the length of the wire in the magnetic field and B is the magnetic field strength. The angle θ, is the angle between the wire and the magnetic field lines.
To calculate the direction of this force we use Fleming's left hand rule. Hold out your left thumb, index finger and middle finger so that they are all at right angles to one another. Line up your index finger with the magnetic field and then line up your middle finger with the direction of the current in the wire. Your thumb will now be pointing in the direction of the force on the wire.