Skip to main content

How Do Magnets Work?

Brandon is a research student who has been working in the Physics niche nearly all his life. He hopes to make quality education free for all

Why Magnets Are Important

I'm sure you've heard the phrase 'opposites attract.' Magnets work pretty much the same way. We're going to be covering the basic principles, and you're going to understand them using everyday objects.

Magnets are amazing and are used everywhere. They help generate electricity, store data on our computer, help stick reminders on the fridge, and they even play a prominent role in the transportation sector (look up maglev trains if you're interested).

How dare I forget the Earth itself! It's a giant magnet without which we wouldn't be here today. Its magnetic field constantly protects us from harmful solar radiation emitted by the sun and other stars.

How Do They Work?

If you're not all beefed up yet, let me point out that there'd be absolutely no electricity in most parts of the globe without magnets. A scenario I can't begin to imagine.

Through this article, I'd like to explain the working of a magnet so that both adults and students can easily understand the principle behind this phenomenon. The best way to learn is via interesting and interactive methods; let's do just that!

What Are They?

Magnets are not elements with complex structures; instead, they tend to have simpler structures than most of the known elements. You could say that they're ordinary elements possessing extraordinary power due to the simple and fascinating internal structure and alignment that they possess.

A magnet is an element that has the capacity to attract or repel like objects.

Ferromagnetic Substances

Those substances that form magnets when electricity is passed through the material or when it comes in contact with a magnetizing field are known as ferromagnetic substances. This magnetization may persist even after the removal of the causative field (Electric or Magnetic). For example: Iron (Fe).

If you're interested in learning more about Ferromagnetism, I've got a bunch of helpful links in the reference section towards the end. Also, check out the great video below:

Understanding Dipoles

For you to understand the working of a magnet, you're going to want to know what's happening inside.

Elements are made up of atoms, and every element has a definite arrangement of these atoms forming some kind of lattice (arrangement). However, this happens in all materials and isn't the cause of magnetism. What really causes magnetism is the magnetic dipoles. Every element contains magnetic dipoles, but they are arranged randomly, canceling each other out. However, in magnetic materials, they are all aligned.

Understanding magnetic dipoles is the key to understanding how magnets work. Therefore, I've taken the trouble to explain this phenomenon in different ways (below). If you still have questions, don't hesitate to leave a comment.

Learning With Lego Blocks

An easy way for me to explain the alignment of magnetic dipoles is via lego blocks. Let's say you have a bunch of lego blocks and you throw them onto the ground. They're going to be oriented in all directions.

Let's say each block can apply a force or has the capacity to pull. Imagine this pull is from the base to the direction of the studs (the bumps on the top of the blocks). Another assumption here is that each of the blocks can apply the same amount of force.

Pick a random point in the middle of your pile and imagine all the Lego blocks to have an invisible chain connecting the center of the block to this point. Now let the blocks begin pulling and tugging on the point. If you have a lot of blocks, the point would end up being pulled equally from all directions and hence have no movement at all.

Non-aligned lego blocks

Non-aligned lego blocks

However, the case of alignment of the magnetic dipoles, you would stack the blocks one on top of another and place them horizontally on the ground. Now consider the same point on the floor as you did earlier. All the blocks pull about this point in the same direction, resulting in its movement (and this resultant force is what attracts metal and other magnetic substances).

Note: This is just an analogy to help understand the process.

Aligned lego blocks

Aligned lego blocks

Understanding Through Chemistry

The image that you see below is a unit cell of boron phosphate (not a magnet). Consider each atom (ball) to be a dipole. These dipoles can be imagined to be randomly oriented. The resultant effective moment caused will be zero since we have millions of dipoles pulling about a point in all directions. Therefore the point remains stationary. Again, this is just an analogy to understand the concept.

Observing Using Matchsticks

Some find it easier to understand with matchsticks, so I hope you've got a filled matchbox or anything similar lying around (earbuds, for example). Open the box and drop all the matchsticks on the ground. Now take a good look at them – they're all going to be pointed in random directions. This is what happens in the case of all materials which are non-magnetic.

Notice the formation closely; you will notice that if one is pointing to the right, there will be another pointing to the left. This is how the magnetic dipoles of non-magnetic elements cancel each other out.

Non-aligned dipoles

Non-aligned dipoles

Now, use another matchbox, this time instead of dropping the matchsticks on the ground. Gently turn the box upside down when it's just above the ground. You'll notice the matchsticks are arranged neatly. In this case, the dipole moments all add up in a particular direction – this is what happens in magnetic materials.

Magnetic Domains: What Are They?

In short, magnetic dipoles lead to magnetic domains. Think of the planet Earth as your material and each country separated by its borders is a domain. The material is made up of many such domains, each with its own direction and purpose.

Let me explain this using the matchstick experiment. Each match is a magnetic dipole and when they all point in the same direction it leads to magnetization. However, you could always group sticks that point roughly in the same direction together and end up having many such groups when the sticks are randomly spread across the floor. Each of these groups is considered to be a domain.

Magnetic domains are imagined to be separated from each other by a domain wall. At the walls, the magnetization rotates coherently from one direction to the next. During the process of magnetization (more on this later) the individual domains align and merge to point in the same direction.

Ferromagnetic materials such as iron, nickel, cobalt as well as their various alloys are magnetic due to magnetic domains. You need not worry about the details of magnetic domains, but the video below explains it beautifully. I personally couldn't do it any better.

Different Types of Magnets

Based on their physical properties, magnets can be broadly classified into two categories:

  1. Permanent magnets
  2. Electromagnets

Permanent Magnets

Permanent magnets are well... Permanent. Of course, nothing lasts forever, and in time (a very long time) even they tend to lose their magnetism. Depending on where and how they are used, they lose their magnetic properties at an accelerated pace.

In permanent magnets, the magnetic domains are perfectly aligned. Naturally, there could be a few domains that are not aligned, but a majority of the domains are aligned which leads to these materials having permanent magnetic properties.

Each and every magnet has two distinct poles, namely the north pole and the south pole.

Permanent Magnet Facts

  1. The Earth is a permanent Magnet protecting us and all life on the planet.
  2. The compasses we use for navigation use the magnetic field of the Earth.
  3. Permanent magnets can be used to erase all data from your computer's hard drive as well as your credit cards! Whenever you delete a file from your computer, it's not actually deleted, it's moved and can be written over (less energy is consumed this way). But, if you swipe a powerful magnet over the hard disk you could lose your data.


An electromagnet is a substance that possesses the property of magnetism only when electricity is passed through it. Whenever you pass electricity through a ferromagnetic substance, such as an iron nail, you'll notice that it acts as a magnet. When current passes through the nail, the dipoles align themselves just like in a permanent magnet. However, the moment the current stops flowing, they begin to go back to a random alignment of dipoles. Some materials retain the magnetism longer than others.

Faraday's Law: A passing current produces a magnetic field.

This means that a magnetic field is produced (rather exists) whenever electricity flows through a conductor. Therefore, electromagnets are also commonly referred to as temporary magnets.

Electromagnet Facts

Some people say that electromagnets are much better than permanent magnets and I may agree with them. Permanent magnets are not that easily extracted and are therefore not just expensive but also harmful to the environment due to all the mining involved.

  1. They are much stronger than Permanent magnets and the strength can be varied.
  2. Magnetic Trains are operated on tracks that are made up of electromagnets.
  3. They were first invented/discovered in the year 1823.

Making an Electromagnet at Home

If you've never done it before, then I'm sure you're going to love doing it. Making an electromagnet is the easiest scientific experiment ever. Just like any recipe, it's going to need a list of materials:

  • A thin wire, but long (insulated wire preferred)
  • An iron nail, about 8–10 centimeters
  • A single cell (AA cells also work)
  • Another nail or paper clip to test your homemade magnet!
  • Any form of tape to hold the wire in place (not a necessity, though)

Now that you've got all the materials needed, this is what you need to do:

  1. Wrap the wire around the nail spirally, leaving absolutely no gaps
  2. Cut off the tips of the insulation (if it's an insulated wire)
  3. Connect the end terminals to the battery positive and negative.
  4. Tape it on or hold it with your fingers while you test out your magnet!
  5. Yes, it's that simple. Have fun!

Further Classification

There are plenty of different kinds of magnets that fall under the basic categories of permanent magnets and Electromagnets, for example, Alnico magnets, rare earth magnets, rubber magnets, sheet magnets, etc.

Understanding Magnetic Poles

Every single one of us has heard of the North Pole and the South Pole. Well, you at least know that Santa stays at the North Pole if not more. The Earth being a permanent magnet does have it's own North and South pole. This does not lie on the same location as the geographical north and south but is shifted by around 10 degrees.

We are already familiar with the concepts of magnetic dipole moments and the magnetic forces caused by them. These forces aren't uniform around any magnet. Instead, they tend to be concentrated at the ends of the magnet. These ends are known as the poles.

The next logical question to ask is: What about round magnets? On closer observation of circular magnets, you will notice that one circular face is the north pole whereas the other is the south pole.

The magnetic force at the center of any magnet is the weakest - to be precise the part at the midplane of the magnetic north and south. Because for circular magnets, the weakest magnetic force is along an entire circular plane between the two faces.

Magnetic Poles Facts

  1. The strength at both magnetic poles is the same.
  2. Like poles of two different magnets repel each other and unlike poles attract.
  3. You can never separate the poles of a magnet. Suppose you try chopping a magnet in half discarding the original south pole, the new end will become the new south pole. No matter the size, a magnet will always have a north and south pole

Magnetic Lines of Force

North and south poles. Lines of force begin at one pole and end at the other.

North and south poles. Lines of force begin at one pole and end at the other.

Experiment to Observe Magnetic Lines of Force

You will need some iron filings, a bar magnet, and any clear surface so that you can easily observe what's happening. A white paper on a glass table would work best (a sheet of paper is preferred as it's easier to get rid of the iron filings).

Place the bar magnet flat on the sheet of paper. Now scatter some iron filings around the magnet. You will notice the filings get attracted to the magnet in a certain way.

Notice that the ends of the bar magnet will have a higher concentration of filings whereas the quantity decreases as you move away from the ends. Also, if you look carefully and if your magnet is powerful enough, you will notice semicircular rings projecting from one pole to the other on both the sides. These are known as the magnetic lines of force.

The poles have more iron filings collecting around them because there's a higher density of magnetic lines passing through them.

Properties of Magnetic Lines of Force

  1. All magnetic lines of force are considered to originate from the north pole and end at the south pole of a magnet – this is a convention.
  2. Magnetic lines of force tend to be highly dense towards the poles and are further apart as you move towards the center of the magnet.
  3. Magnetic lines of force never intersect each other.
  4. Place a compass on the magnetic poles of the Earth, and it will just keep rotating, never coming to rest.

Distinguishing the Poles of a Magnet

There are two ways that I know of to determine the poles of a magnet:

  1. You could use another magnet that has its poles marked – the very simple way.
  2. Use the law of magnetic poles to determine the North Pole – the simple way.

If you've completely understood the concept behind the working of magnets, I'm sure you'll have an idea of what needs to be done to determine the poles using one where the poles are already marked.

Let's say you've got a bar magnet where the north pole and south pole are already marked. You've also got with you a magnet of unknown polarities. Hold the magnet towards the North of this bar magnet. Switch directions until the magnets repel each other. The end which is repelled is the North Pole of the second magnet, and the opposite end is obviously the South Pole.

Since we already know that like poles repel and unlike poles attract the above conclusion was drawn. If you're really thinking, you may ask why can't you get the south pole using the north pole? This is because the magnet will have a slight attractive power no matter which part you hold against it unless you're holding a like polarity towards it. Alternatively, you could use the repulsion of south poles to determine the poles.

The Law of Magnetic Poles

You would need a bar magnet and a thread to help you determine the poles of the magnet. Tie the thread about the center of the magnet such that you can hold on to the thread keeping the magnet horizontal. Lift up the magnet and you'll notice that every single time a particular end of the magnet points towards the North Pole (of the earth) – this end is the North Pole of your magnet and the other end is the South Pole.

Now you may ask – isn't the north pole of the earth supposed to repel the north pole of the magnet? Remember: The north pole of the earth isn't the magnetic north of the globe. However, in this direction, you will find the magnetic south pole of the earth.

To understand the concept you could consider the magnetic south to be located at the geographic north and vice versa; even though, there's a slight displacement.

Where Are They Used?

I can't think of anything in modern society that would be possible without the use of magnets. The generation of electricity uses magnets (unless you're using solar power). Then again, it would be near impossible to create your first solar panel without having an existing source of electricity.

  • Try closing your refrigerator door, it closes automatically when left slightly ajar – magnets!
  • Do you commute to work or school via the metro? There's a high probability that it runs on magnetic tracks.
  • How often do you use your computer? If it weren't for magnets, it could not be invented.
  • Microwaves – to warm our food or make popcorn.
  • Your earphones and music player, your mobile as well.
  • The list goes on and on; all gadgets and electronic devices use them.

They Also Work in Space

The earth is a giant magnet and it's magnetic lines of force extend into space. But would a regular refrigerator magnet work in space?

This is a rather good question, but if you consider the basics of magnetic forces you should know that magnetic dipole alignment is irrespective of atmosphere and any other such physical factors. Therefore, magnets work in space.

Similarly, magnets work under water too. This is another question that comes to mind when children learn about magnets.


  • A Theory of Ferromagnetism
    Work by Linus Pauling: Gates and Crellin Laboratories of Chemsitry, California Institute of Technology.
  • HyperPhysics
    HyperPhysics is a resource initiated by high school teachers and is now spread across 81 countries. This article is my favorite if you're looking for a quick yet complete overview on Ferromagnetism.
  • Physics Handbook
    Physicshandbook is a website for short intros to everything Physics. A short 3 minute read and you will learn enough about Ferromagnets to proceed comfortably.
  • Wikipedia Ferromagnetic Materials
    How could I leave out the famous Wikipedia, it's got a pretty interesting article on Ferromagnetism which covers the history and not so scientific aspects as well.
  • Further Classification of Magnets
    Themagnetguide provides a complete classification of magnets used in various industries across the globe. It's a very useful link if you're creating a presentation for school.

© 2017 Brandon Lobo


Brandon Lobo (author) on April 18, 2020:

Thanks, I'll check them out. Thanks for the follow as well.

bhattuc on April 18, 2020:

Nice article. Well explained. I am also writing basic articles (hubs) in Physics.

Brandon Lobo (author) on February 06, 2017:

That makes sense. We tend to go around them all the time, the Zeroth Law of Thermodynamics is just another smart way of doing it that comes to mind ;). With respect to the magnetic fields, we chose to distinguish between geographic and magnetic North and South.

Glenn Stok from Long Island, NY on February 06, 2017:

Yeah, I would have thought that compasses were made backwards to compensate. But since the Earth's fields are the other way, the only thing I can guess is that people started calling the North Pole North because the North Pole of a magnet points to it. It may have all started from that and no-one made the correction. Incorrect terminologies tend to stick when it becomes standard jargon.

Brandon Lobo (author) on February 06, 2017:

Hehe, the next topic of research when I'm bored is to find out why it is so :) I mean, why the geographic poles of the Earth are marked with the opposite of the regular sign convention.

Glenn Stok from Long Island, NY on February 06, 2017:

There is surely a lot to be understood about magnetism and you covered the entire subject very well.

One thing in particular that I'm glad I learned from you is that I always thought compasses were labeled backwards so that he needle marked N pointed to the North Pole. But I was wrong. As you pointed out, it's actually the Earth that's the other way around. I just double-checked to be sure. You are definitely correct! What we call the North Pole is magnetically South, and our South Pole is magnetically North.

Brandon Lobo (author) on February 05, 2017:

Sure bye. Have a nice day.

Monk E Mind from My Tree House on February 05, 2017:

Gotta Run! Been interesting. AND I agree, science should be fun and interesting!

Monk E Mind from My Tree House on February 05, 2017:

There is a difference between concepts and phenomena:

All phenomena are concepts, not all concepts are phenomena.

A concept is the relation between objects or nested concepts, a phenomenon is the surface to surface contact between two or more objects.

One can have a concept like three-wheeled unicycles, but of course that is impossible.

Unless one can illustrate the objects, we have no understanding of what they are talking about.

That's referring to objectHOOD. In order for something to exist, it must have shape AND location with respect to all other objects.

Brandon Lobo (author) on February 05, 2017:

Exactly! Not one explains them using objects. But why not! That's the reason I've tried to bring the two together to help people who are not yet deep into science to understand the concept. After my relations (in the article above), I've clearly stated that they are just analogies to help understand the concept.

P.S: Thanks for the discussion, I'm sure it's going to help someone someday.

Monk E Mind from My Tree House on February 05, 2017:

I've searched the WEB and looked at many scholarly articles, and not one explains magnetism using objects, only concepts; force, lines of force, magnetic moment, etc. etc.

I'll let you know if I ever find something, but don't hold your breath!

Take Care!

Brandon Lobo (author) on February 05, 2017:

What I meant through my last concept was in reference to your comment on the leash and the iron filings. Force can be witnessed (as a thing), it by itself is a phenomenon (not a concept, because it's true - it exists). The same goes with the magnetic field. It's a phenomenon, whose influence tends to zero at an infinite distance from the origin of the phenomenon. The origin being the magnetic moment due to the revolution of the electrons within atoms of the body.

I completely agree that it's not an article NOT explaining HOW magnetism works. It's an article explaining how MAGNETS work. There's a huge difference and I'm sure you will agree.

Also, I am not trying to explain the working of magnets to people who already understand some basics regarding magnetism, why would you be here if you understand it anyway? I mean other people, you are a fellow writer on this website and that's how you got here. But I am writing for an audience who has no clue about magnets. I want them to understand the surface of the concept and hopefully, it will ignite something in them that wants to learn more. There are plenty of research papers they can read to know more. If someone does this, I would say my article succeeded. My goal is to help people understand in a simple way and not make them hate physics or science in general just because there's a lot of hocus-pocus they do not understand.

Monk E Mind from My Tree House on February 05, 2017:

It's a good article, underscoring what mainstream science says about the subject, but NOT an explanation for HOW magnetism works. What are the physical mechanisms of the phenomenon.

With the man, dog, leash we have objects mediating forces. We have to. It's always the case. It takes two or more objects for any phenomenon to occur.

Monk E Mind from My Tree House on February 05, 2017:

You're getting your objects and concepts mixed up!

Force can not be an object (someTHING) and also an interaction (what something is doing).

AND if a magnetic field is a thing (synonym:object) then it can not be infinite because by definition an object has shape and location, it is physically present;something somewhere!

Brandon Lobo (author) on February 05, 2017:

"what are lines of force? They draw them as though they are objects but force is NOT something it is what something is doing. A magnetic field is not someTHING, it is a region where attraction/repulsion is occurring. By what physical mechanism(s)?"

Force is something. Force is an interaction between bodies. My previous comment has explained what lines of force are. The magnetic field of a magnet is in theory, infinite. The possibility of attraction/repulsion tends to zero at infinity.

Brandon Lobo (author) on February 05, 2017:

Isn't science all about hypothesis and theory that uses mathematics as a foundation?

Experiments based on these hypotheses and theories are then conducted and when the physical world repeatedly behaves the way it was predicted to, they are then transformed into laws. And Faradays Law is used to explain the relation between magnetism and electricity for instance.

Lines of force are easily witnessed, look at my experiment in the article to view the lines of force. If you can understand a force between a dog and a man thanks to the leash, you should be able to understand the lines of force. I would say that it's a concept that explains the phenomenon, but it's not just a concept, it's a fact imo.

Monk E Mind from My Tree House on February 05, 2017:

I mean obviously, the phiz whiz understands that dipoles are objects, but what are lines of force? They draw them as though they are objects but force is NOT something it is what something is doing. A magnetic field is not someTHING, it is a region where attraction/repulsion is occurring. By what physical mechanism(s)?

Brandon Lobo (author) on February 05, 2017:

Thanks for the link to the Physics StackExchange forum. What Anna has said is absolutely true, 100%. But I still stick to what I said, an Ape cannot do it. It needs to be done in a certain way and not random hits.

Another fun experiment you could try just uses a ferromagnetic paper clip and a refrigerator magnet. Slide the magnet along the paper clip from one end to another holding the magnet in the same orientation all the time. Do this quickly and constantly for around 10 minutes and you'd notice your paper clip is now a temporary magnet. This works in the same way, by forcing the dipoles to align to the field of the magnetizing magnet.

Monk E Mind from My Tree House on February 05, 2017:

My point is that there are no explanations for magnetism. Only descriptions.

Magnets attract/repel as a function of the inverse square law, etc. does not explain anything about WHAT is pulling and what is pushing.

If I see a dog on a leash pulling a man, I understand this force. BUT what are lines of force? Spirits? Ghosts? Fairies?

Brandon Lobo (author) on February 05, 2017:

Hi there, there has been a guy who writes on physics topics that was posting crazy comments without reading the article. I had 6 in the last 2 days. And then I woke up to this one. I assumed it was him again. I'm sorry about that.

Anyway, did I manage to help you with your questions?

Oh yes, there are bad students. Students who do not want to learn, but are forced to learn. Believe me, I've had classmates who were there just because they needed a degree and even the best of teachers couldn't help them.

Monk E Mind from My Tree House on February 05, 2017:

Just one quick response:

Yes. hammering AN iron nail can make it magnetic. BYW, hammering a magnet can make it it less magnetic. It has to do with aligning those "dipoles."

Monk E Mind from My Tree House on February 05, 2017:

I've never posted here before sir. I just didn't bother to sign in my last comment.

I'm hoping that I won't be wasting my time with you deleting my comments. If you prefer I not post please let me know now so that I don't waste my valuable time responding to your comments.

BTW, there are no bad students, only bad teachers.

Brandon Lobo (author) on February 05, 2017:

If there's something worse than a bad student, it's a troll. I'm fed up of deleting your comments from a registered hubbers account and now various guest accounts, and so I'm just going to reply to them. It's pretty obvious you've not gone through the article or have even a minor understanding of magnetism. Something you would have gained if you simply read the article, rather than come here to criticize.

What is the connection between electricity and magnetism? Scroll up and notice that I mentioned Faraday's law. If you want to know more about it, Google is your friend. This is an article on magnetism and not an encyclopedia.

What are dipoles?! Seriously... I've used three different scenarios to explain them. Read! Only then can one understand.

An ape can pound on an iron nail, you say? Btw it's an iron nail, not 'a'. Sorry to disappoint but no matter how much the Ape pounds on a nail, it's not going to turn into a magnet. That's not how it works. Go back and read my article from the start and you will understand.

Feynman can't explain how magnets work? To be honest, I'm familiar with is work, but not sure whether he understands the concept or not. Let me explain: At the atomic level magnetism originates from the spin and orbital magnetic moment of electrons. And when the electrons spin in the same direction, the magnetic moment is in the same direction, which results in magnetism. I hope you now see the relation between electricity (electrons) and magnetism.

The "force" I refer to is the force of attraction or repulsion. Two like charges repel and unlike charges attract. And in my statement above, I've explained the scenario at a molecular level, and the issue should be clarified.

Monk on February 05, 2017:

"Ferromagnetic substances are those substances that form magnets when electricity is passed through the material or when it comes in contact with a magnetizing field."

What is the connection between electricity and magnetism. What is electromagnetic force?

You say that when magnetic dipoles line up we have magnetism. What are dipoles?

An ape can pound on a iron nail and make the atoms align forming a "magnetic field," but even theoretical physicists, like Feynman, apparently can't explain how a magnet works!

AND, I'm no closer to understanding how magnetic dipoles create a "field," and what generates the "force" you call pull from a distance.

Is this the same mechanism that causes the "force" of pull?

MonkEminds want to know!

Brandon Lobo (author) on February 04, 2017:

Hi Melbel, thanks for the comment. Glad you found it fun and interesting. My main aim was to make the learning experience less boring. I love to make people want to learn out of interest rather than compulsion.

Melanie Palen from Midwest, USA on February 04, 2017:

Wow! This is amazing! I've never known much about magnets until last semester when I took Electricity & Magnetism. This article makes the topic fun and interesting, great share!