Can a strong magnet destroy digital information?

im just curious,can a magnet destroy the transistors(bits)into a usb stick or sd card?or in a hard disk drive if its possible?

As for the USB sticks and SD cards, they are not magnetic storage. However, they could still be harmed by an extremely powerful magnet (like that in a CAT scan), as they contain metal and could be ripped apart. But I’m guessing that’s not what you mean. So a USB stick or SD card is more or less magnet-proof.

Hard drives, on the other hand, are magnetic storage. So a strong magnet can screw them up. But not as easily as it could in the past. These days, hard drives use extremely strong (neodymium, or "rare earth") magnets. Those magnets are extremely close to the "platter" that contains your hard drive’s information. So, in order to damage that data, you would need an extremely strong magnet and/or a magnet very close to the drive’s platter (so you’d have to open the drive).

Quick science lesson:

Magnetic force decreases with the inverse square of the distance. So if your magnet is 4 times the distance from an object, it would need to be 16 times as strong in order to provide the same effect. So if the magnet on a hard drive is .1mm from the platter, and you placed a magnet on the outside of the drive casing (say, 1cm away from the platter), it would need to be 10,000 times as strong as the magnet inside the drive to have the same effect (and therefore, wipe the drive).

So you can be pretty confident that unless you have a very strong magnet and you place it on top of the drive in question, then you are unlikely do do any serious damage to the drive.

Disclaimer: This is all theory. I have no experience in actually trying all this out. If you do manage to damage a drive with a magnet, don’t come crying to me about it. I’m just some guy who says stuff on the internet.