Home > Guides and How To's > How Does the Laptop Know the Lid Is Closed? (Explained for Beginners)

How Does the Laptop Know the Lid Is Closed? (Explained for Beginners)

| Updated:

Most people who use laptops tend to close their laptop lids when they want to stop or pause operations. It is a simple and very efficient way to put the notebook into sleep mode to preserve power until you are ready to resume working. The following article discusses how the laptop knows or detects that you have closed the lid.

How does the laptop detect the lid is closed?

There are several ways a laptop can detect that you have closed the lid. The preferred detection method for older laptops was a physical, mechanical switch placed near the hinges or the top of the display. Once the lid closes, the controller would signal the operating system to initiate the configured power setting, whether sleep, hibernate, shut down or do nothing.

Newer laptops use magnets and hall effect sensors to detect every time the display is closed. The sensor typically gets engaged when the lid is closed, turning off the internal LCD. The sensor then moves the display output to the external monitor if present or puts the laptop to sleep or hibernation. 

Can magnets affect the laptop lid sensor?

The hall sensors used in laptops are sensitive and can be affected by magnetic fields from external sources. Some of the common symptoms of these issues include random shutdowns, display issues, or instances where your laptop unexpectedly enters hibernate or sleep mode. When external magnetic sources are placed close to the laptop lid sensor, these issues can happen.

Some items that can affect the proper operation of your laptop lid sensor include:

  • Smartwatches
  • Magnetic jewelry
  • Some smartphones
  • Wireless charging devices
  • Active magnetic stylus pens

The recommended best practice when dealing with any electronics is to ensure no magnets are nearby that can interrupt the devices. Hence, you should keep any magnetic items away from your laptop to avoid activating the lid closing sensor.  

Can you disable the lid closing sensor on a laptop?

Some external monitors designed for laptops usually come with magnetic attachment mechanisms. However, this presents an issue since external magnetic fields can disrupt the optimal functioning of your notebook, as shown above. Hence, a possible solution would be to disable the lid closing sensor so that you can attach the external monitors to the back of your laptop.

Even though some laptops allow you to disable the lid detection in the BIOS, most manufacturers do not offer this capability by design. Ultra-thin and lightweight notebooks are particularly more vulnerable to the effects of strong magnets nearby due to their thin chassis. For thin laptops, consider using stand-alone external displays that come with their stands and don’t require magnets.

Can a laptop run with a closed lid?

Generally, laptops enter sleep mode or shut down when you close the lid. However, there are certain times when you may need to keep using the laptop even with the lid closed. For instance, if you want to add an external display with limited desk space, you might consider folding the notebook and only using the secondary display.

In addition, specific workflows like video editing usually require a large display to view the entire timeline easily and conveniently make the necessary edits. In this case, you can close the lid of your laptop and continue working on the more prominent external display without any issues.

Here’s how to use your laptop with the lid closed in Windows, Mac, and Ubuntu laptops.

Here are the steps to follow for those using a Windows laptop:

  • Click the start button and search for Control Panel
  • In the Control Panel menu, select the Hardware and Sound section
  • Click on Power Options and then pick “Do Nothing” under the option “When I close the lid.”

Follow these steps to keep your MacBook on even when the lid is closed:

  • Click the Apple menu icon and select System Preferences
  • Select Energy Saver and then click on the Power Adapter option
  • Next, move the slider under the “Turn display off after” section to Never

Here are the steps to follow on laptops with Ubuntu:

  • Open the system menu and select Terminal
  • Run the command: sudo gedit /etc/systemd/logind.conf
  • Enter your password
  • Next, find the line “#HandleLidSwitch=suspend” in the logind.conf file and change it to “HandleLidSwitch=ignore”
  • Save the file and then restart the session to apply the changes

The options shown above for working with the laptop lid closed entail adding an external display or monitor. Also, you will require investing in external input devices, including an external mouse and keyboard. Overall, using a laptop with the lid closed can help you save on space, improve your posture, enhance your productivity and give you a better viewing experience on the larger, better quality monitor.

The laptop lid is not closing properly

It can get frustrating if your laptop lid does not close properly due to a swelling in the keyboard or touchpad area. This malfunction is quite dangerous as it is usually linked to swollen lithium-ion batteries. There are several reasons why your laptop battery starts to swell up, including overcharging, deep cell discharge, and manufacturer’s defect.

If your laptop lid cannot close because of a swollen lithium-ion battery, then the first thing to do is to be very careful. You should avoid puncturing the battery and handle your laptop with extra care. If it is a removable battery, you can try carefully removing it before disposing it at a delegated battery disposal location. If your notebook doesn’t have a replaceable battery, take it to a repair shop and have skilled experts handle it.

Since owner mistreatment and bad laptop handling are significant contributors to battery swelling, you should always be careful about using your notebook. Here are a few suggestions to prevent experiencing a swollen battery:

  • Use a suitable, high-quality charger
  • Avoid leaving your laptop plugged in for a long time
  • Use your notebook in a cool environment
  • Replace your laptop battery if you notice any swelling or damage


You should now know what happens every time the lid closes on your laptop. While older laptops used physical, mechanical switches, newer ones now use magnets and hall effect sensors to detect when the lid closes.

Pigtou.com is supported by its audience. When you buy through the links on our website, we may earn a small commission.
Photo of author

Pigtou Editorial Team

A group of tech enthusiasts who find pleasure in troubleshooting and resolving various issues. When we're not engaged in writing, we typically enjoy playing table football or spending time with our office dog.
NEED HELP? Drop a comment below!

You can also post your problem to the PIGTOU FORUM.

Leave a Comment