Windows typically come with their own locking mechanisms, but these don’t always last as long as the windows themselves. Who hasn’t had the experience of trying to lock a 30-year-old, wooden, single-hung window only to find that swelling prevents the window from closing far enough for the latch to engage? Several coats of paint can also block your locks from functioning properly.

When your original window locks no longer work, you expose yourself and your family to intruders, but it’s fairly easy to avoid that by being proactive and installing new ones. You can even rig up your own DIY locks. They will be Grade 3 locks, which is the lowest grade in terms of security, but unless you live on the ground floor in a dangerous neighborhood, that’s usually all you need.

The type of lock you install depends on the type of window you have. Single and double-hung windows need a mechanism to prevent them from sliding vertically and sliding windows need a lock to prevent them from sliding horizontally. Casement windows (and awning windows) are like doors: They need to be secured to the jamb so they can’t swing outward. Here are some simple homemade locking devices that I’ve used on the windows in my own house.

Single and Double-Hung Windows

Single-hung windows feature one moveable sash and a fixed sash, while double-hung windows have two moveable sashes. The sashes move vertically, and the windows are usually supplied with latches that secure the sashes together. As these windows age, the sashes tend to wedge against the sill or the top of the window and won’t close far enough for the latch to engage. You can fix this problem in several ways:

Use a pin

You can prevent these windows from opening with a fairly hefty metal pin, such as the one from a standard door hinge.

  1. Close the window as far as it will go.
  2. Drill a hole through the top of the lower sash and into the bottom of the upper one, using a drill bit with a diameter about 1/8 inch larger than the diameter of the pin. (A larger hole prevents the pin from getting stuck).
  3. Insert the pin into the hole.

Pro tip: Measure the thickness of the window frame, double it, and subtract an inch. Then, at that distance from the tip, wrap masking tape on the drill bit to act as a depth gauge. Stop drilling when the tape contacts the frame. This prevents the bit from penetrating the other side of the frame.

Use a barrel bolt

This fix involves a standard barrel bolt, such as the type you use to lock a gate.

  1. Close the window as far as it will go.
  2. Choose a convenient height for the barrel bolt on the vertical part of the sash frame (it doesn’t have to be at the bottom) and screw it to the frame about a half inch from the outside edge.
  3. Slide the barrel until it touches the window jamb, mark its position, then open the window far enough to be able to drill a hole on the mark. Use a drill bit about 1/8 inch larger in diameter than the barrel to prevent sticking.
  4. Close the window and lock it by sliding the barrel into the hole on the jamb.

Use a stick

This is the easiest way of all to prevent someone from opening your single-hung window from outside, and it’s a great solution if you live in a rental and don’t want to deface the window by drilling holes.

  1. Close the window
  2. Measure the distance between the top of the sliding sash and the inside edge of the top of the window frame. Cut a length of 3/4-inch dowel to this length.
  3. Wedge the dowel between the sash and the window frame and push it to one side to keep it out of sight. No one will be opening that window from inside or outside until you remove the dowel.

Sliding Windows

You can use either the pin or stick techniques described above to lock a window with a horizontally sliding panel. The stick technique is probably the best locking solution for an aluminum window because drilling aluminum—while possible—is impractical.

Casement and Awning Windows

A barrel bolt will securely lock a casement or awning window. You can also use a keyed push lock, which works the same as a barrel bolt but can be locked with a key. Here’s how to do the installation:

  1. Close the window, using the crank to get it as tight against the jamb as possible. If there’s weatherstripping in the way, make sure you close the window far enough to compress it.
  2. Align the barrel bolt or keyed lock at your preferred height on the window frame. It will hold the window most securely if you put it in the middle, but pretty much anywhere is OK. If you’re installing it on an awning window, it should be in the middle of the bottom part of the frame. Position it about a half inch from the jamb and secure it in place with screws.
  3. Push the barrel against the jamb to make a mark, then open the window and drill a hole on the mark. Use a drill bit with a diameter slightly larger than the barrel.
  4. If the bolt or keyed lock comes with a strike, position the strike over the hole and screw it in place.