How to Create a Hidden Magnetic Gate Latch




About: We’re a group of people that have a passion for magnets and their endless possibilities. Our aim is to help people understand how magnets can be used.

Creating a hidden gate latch need not be a costly or a difficult job. There are several ways you can create a hidden locking mechanism on a garden gate, including different ways of using magnets.

Peter, from Cambridgeshire recently emailed our technical experts in search of a little advice and inspiration. Peter explained that he was in the process of creating a gate to keep his cats out of a section of his garden. Peter had considered cup, magnet and steel disc systems but was looking for a more cost effective solution.

Peter had heard that using countersunk magnets with opposite poles on their countersunk faces could be a solution but had a few questions. With a little extra guidance from our technical experts, Peter was able to find the perfect magnets.

Peter asked if the magnets he was going to purchase needed to be touching. This is a very common question and the answer is no they don’t, strong magnets like neodymium countersunk magnets are powerful enough to attract each other through an air gap, although the bigger the gap the weaker the attraction. Strong magnets will continue to be effective even through a gap of several millimeters. However, if you anticipate there being a gap between two magnets you may need to use larger magnets.

Peter was also concerned about the possibility of the magnets constantly coming into contact with each other and damaging them. Peter was right to be concerned as strong magnets are made from neodymium, which is a brittle material and prone to corrosion when not coated or protected. However, this can be easily solved by using magnets with a rubber coating, which will also protect the magnets from the elements

Step 1: Source Countersunk Rubber-coated Magnets

You will need one rubber-coated neodymium magnet with a north countersunk face and one with a south countersunk face of the appropriate size. You can get 27mm diameter and 40mm diameter varieties which are countersunk on both sides from

Step 2: Attach One Magnet to Backing Piece

Fix one of the magnets to a piece of fencing to match your gate and fix the magnet to it using a brass or stainless steel screw. This is important to prevent the screw drawing any of the magnetism.

Step 3: Attach Backing Piece to Gate Frame

Fix this piece of wood to the frame of your gate so that the magnet is facing the inside of your gate.

Step 4: Attach Other Magnet to Gate Panel

Fix the other magnet to the inside of your gate in the appropriate position so that it meets the magnet attached to the gate frame.

Step 5: Done!

The magnets will now attract each other, keeping your gate closed.



    • Paper Contest

      Paper Contest
    • Weaving Challenge

      Weaving Challenge
    • Trash to Treasure

      Trash to Treasure

    8 Discussions


    4 years ago on Introduction

    I really like this idea. I'm going to try this on a few projects next year.


    5 years ago on Introduction

    Very nice. But with just a little more work you can hide the magnets from view and corrosion. I used something like this years ago when I had housemates that smoked. We'd put ashtrays out on the back deck, but here in San Francisco they'd blow away. So I used a forstner bit to countersink a hole, then filled the hole with wood putty to match. After that, an old tuna can would stay put, or any ashtray with a metal plate glued to the bottom.


    If you need to keep out a dog, just put the magnet at the base of the gate where the dog would push - much more force would be needed to open the gate. For a really big dog, add another in the middle!

    3 magnets could keep out some humans, though. : P


    5 years ago on Introduction

    I have used ceramic "domino" magnets that have 2 countersunk holes to do the same thing.
    Got them for 50 cents from


    5 years ago on Introduction

    I used solid magnets (not countersunk) with a little glue under them.
    Use a forstner bit to drill the hole size you need. (A regular bit will work but will require more glue)
    Then glue the magnet in.
    It gives you a flush mount with having to see that screw head.

    1 reply

    Reply 5 years ago on Introduction

    Hi Arkain,

    That is another great way to make hidden latches. Its a popular tactic employed by many furniture makers in household products. It is important to get a magnet with a coating though if using neodymium as neodymium can be prone to corrosion.

    We would also recommend just creating the hole a little deeper than the thickness of the magnet to stop two magnets (or a magnet and ferrous surface) from constantly hitting together as magnets, particularly strong neodymium magnets, are brittle. We've got a whole section about neodymium magnets on our website.


    That's pretty slick! How much force can they withstand before you push open? Could a medium size dog wiggle out?

    1 reply

    The latch on this gate was designed to keep cats out of a particular part of the garden. A medium-sized dog could push it open if it tried hard enough, although that could be solved with larger magnets. The ones in the instructable are 27mm in diameter and used together will have a magnetic pull of almost 7kg.

    Hope that helps :)