An efficient inversion scheme is given to derive the local currents in a superconductor from the z component of the magnetic field measured above its surface, as is done using magneto-optical indicators. The method works for samples of arbitrary thickness provided that the current vector has only x and y components. Data storage is much lower and convergence much faster than in previously reported schemes. The influence of the distance of observation and of the sample aspect ratio on the measured field H z is investigated. The current calculated from the magneto-optical observation of a real sample ͑a Bi 2 Sr 2 CaCu 2 O 8 single crystal͒ is in good agreement with the value measured directly by means of torque magnetometry.