A method for compensating for external magnetic fields in memory devices that includes positioning at least one external magnetic field sensing element adjacent to at least one array of memory cells, wherein a write driver is in electrical communication with at least one external magnetic field sensing element and at least one array of memory cells. The at least one external magnetic field sensing element is monitored for signals indicative of the present of an external magnetic field. The write current to the at least one array of memory cells can be adjusted by trimming the write driver to operate the memory device while compensating for the external magnetic field.