Last updated: October 2026
- The short answer: the tool is legal, the use decides
- The principles that decide almost every case
- Who owns the device?
- Did the person consent?
- Was there clear notice?
- Is there a legitimate purpose?
- Whose data is captured?
- What the law says in the United States
- The Wiretap Act and ECPA
- The Stored Communications Act
- The Computer Fraud and Abuse Act
- State laws and consent differences
- What the law says in the United Kingdom
- What the law says in the European Union
- The main laws at a glance
- Employers monitoring company devices
- Parents monitoring their own child
- Spouses and partners
- Using a keylogger on a device you do not own
- Law enforcement and security research
- Gray areas readers ask about
- Does the type of keylogger change the law?
- Legal vs illegal: common scenarios
- What to do if you were keylogged illegally
- Before you use any keylogger: a decision checklist
- The bottom line
- Key takeaways
- Frequently asked questions
- Is it legal to buy a keylogger?
- Can I put a keylogger on my partner’s phone?
- Can my employer keylog a work laptop?
- Can parents keylog a child’s device?
- What happens if I keylog a device I do not own?
- Is it legal to buy a keylogger?
- Can I put a keylogger on my partner’s phone?
- Can my employer keylog a work laptop?
- Can parents keylog a child’s device?
- What happens if I keylog a device I do not own?
Keyloggers sit in an odd legal spot. The same tool can be a lawful safety aid on your own laptop and a crime when it secretly records someone else.
This guide explains the rules in plain words. It covers the United States, the United Kingdom, and the European Union, plus the gray areas around parents, employers, and partners.
Quick answer: A keylogger is usually legal to buy and own. Legality turns on how you use it: who owns the device, who agreed to the monitoring, and whose data is captured.
Secretly keylogging another adult’s device is illegal in most places, even inside a marriage. Monitoring your own device, your minor child’s device, or staff devices with clear notice is usually allowed within limits.
Please note: this article is general legal information, not legal advice. Laws vary a lot by country and state, and small facts can change the answer. For a real case, a local lawyer is the right source to ask.
The short answer: the tool is legal, the use decides
Keyloggers are dual-use tools, like a voice recorder or a screen recorder. Shops sell them openly, and owning one breaks no law in most places.
Trouble starts at the moment of use. Installing a logger on a device you do not own, or recording a person who never agreed, is where criminal law steps in.
That is why two people can use the same app and get opposite results. One logs a family PC with everyone informed, while the other hides it on a partner’s phone. Product pages for the best keylogger for Android pitch parental control and staff monitoring, because those are the uses the law most often allows.
The principles that decide almost every case
Courts and regulators rarely ask which brand of keylogger you used. They ask a short set of questions, and your answers decide the case.
Who owns the device?
Ownership is the strongest starting point. Logging a computer or phone you own is far safer than touching one that belongs to someone else. Paying for the phone plan or sharing a home does not make a device yours.
Did the person consent?
Consent means the user knows about the logging and agrees to it. Silence is not consent, and a buried line in a long contract is weak ground. Clear consent, given before logging starts, is the standard that protects you.

Was there clear notice?
Notice is consent made practical. A login banner, a signed policy, or an open talk at home all tell the user what is recorded and why. Secret logging is what turns most lawful tools into illegal surveillance.
Is there a legitimate purpose?
A real purpose matters: keeping a child safe, securing a work network, or finding your own stolen laptop. Curiosity, jealousy, and control are not purposes any court respects.
Whose data is captured?
A logger records everyone who types, not just the person you aim at. Friends, coworkers, and visitors can all end up in the log. The wider the capture, the weaker your legal position, and the same questions apply to physical devices, as our guide to hardware keyloggers shows.
What the law says in the United States
Federal law in the United States approaches the problem from three sides: live interception, stored records, and unauthorized access. Many states then add their own wiretapping and computer crime laws on top.
The Wiretap Act and ECPA
The federal Wiretap Act, part of the Electronic Communications Privacy Act, bans intercepting electronic communications while they happen. Keystroke logging that captures messages as they are sent can fall under this ban, which sits in title 18 of the U.S. Code, section 2511.
The Act also has a consent exception. In many cases, interception is allowed when one party to the communication consents, though states can set stricter rules, as explained below.
The Stored Communications Act
The Stored Communications Act covers data that is already stored, such as emails sitting in an account. Reading someone’s stored messages without authorization can break this law, even if nothing was intercepted live.
The Computer Fraud and Abuse Act
The Computer Fraud and Abuse Act, at title 18 of the U.S. Code, section 1030, bans accessing a computer without authorization. Installing a keylogger on a device you have no right to use is the classic case this law catches.
Victims can also sue for damages in civil court. One secret install can therefore lead to both a criminal case and a civil claim.
State laws and consent differences
States add their own wiretap and computer crime statutes, and they do not all match. For recordings, many states follow one-party consent, while others require every party to agree.
That split matters for any tool that captures calls or audio as well as keys. A setup that is lawful in one state can be a crime in another, which is why local advice matters.
What the law says in the United Kingdom
The Computer Misuse Act 1990 is the main UK law in this area. Section 1 of the Act covers unauthorized access to computer material, and a keylogger on someone else’s device fits that pattern.
Data protection law adds a second layer. Under UK GDPR and the Data Protection Act 2018, anyone who collects personal data, including an employer, needs a lawful basis and must be open about the collection.
Secret monitoring of an adult in the UK is therefore risky on two fronts at once. It can be a computer misuse offense, and it can also breach data protection duties.
What the law says in the European Union
In the EU, the GDPR controls how personal data may be collected. Keystroke logs are personal data, so you need a lawful basis, and consent must be freely given, specific, and clear.
Employers often cite legitimate interests as their basis, but that basis has limits and needs a real balance test. It rarely covers secret or total monitoring of staff.
The ePrivacy rules add protection for the confidentiality of communications and of devices. Reading data stored on someone’s phone or computer without consent can breach those rules too.
The main laws at a glance
This table sums up the laws named above. It is a map of the landscape, not a substitute for the full text of each law.
| Law | Country or region | What it covers |
|---|---|---|
| Wiretap Act (part of ECPA) | United States, federal | Intercepting live electronic communications |
| Stored Communications Act | United States, federal | Accessing stored messages and records without authorization |
| Computer Fraud and Abuse Act | United States, federal | Accessing a computer without authorization |
| State wiretap and computer crime laws | United States, states | Extra consent and access rules that vary by state |
| Computer Misuse Act 1990 | United Kingdom | Unauthorized access to computer material |
| UK GDPR and Data Protection Act 2018 | United Kingdom | Lawful basis and openness when collecting personal data |
| GDPR and ePrivacy rules | European Union | Consent, legitimate interest limits, and communication privacy |
Employers monitoring company devices
Work is where keylogging is most common, and where the rules are clearest. The company owns the device, and staff use it under a policy.
Company-owned devices with clear notice
An employer can usually log a company laptop when staff know about it. A written acceptable use policy, signed at hiring, plus a login banner gives the notice the law expects.

The logging still has to stay in proportion. Recording work activity on work systems is one thing, but capturing personal passwords and private chats on the same machine goes further than most policies allow.
Personal devices and secret monitoring
The risk flips when the device is personal. Logging a phone the employee owns, even one used for work, can break wiretap and computer misuse laws.
Secret monitoring is risky even on company devices. Regulators expect openness, and hidden tracking of staff is the pattern that draws enforcement and lawsuits.
Parents monitoring their own child
Parents sit in the strongest legal position of any group in this guide. A parent may generally monitor a device they own that their minor child uses, because parents have a duty to keep the child safe.

Limits still apply. Rules in some places set age lines, and older teens gain stronger privacy rights, so a setup that suits a nine-year-old may not suit a seventeen-year-old.
Honesty is the safest practice as children grow. Tell the child what is watched and why, and loosen the checks over time. Our step-by-step guide on how to monitor your child’s phone shows a balanced setup.
Spouses and partners
A marriage certificate is not a monitoring license. Each adult keeps a legal right to private communication, even from a spouse.
Secretly keylogging a partner’s phone or laptop is illegal in most places. It can trigger wiretap or computer misuse charges, and the evidence it gathers can hurt the spy in divorce or custody cases.
Apps built for this purpose often fall under the label of stalkerware. If you find one on your phone, our guide on how to remove stalkerware explains the safe steps to take.
Using a keylogger on a device you do not own
This is the clearest case in the whole guide. Putting a keylogger on a device you do not own, without the consent of the owner and the user, is illegal in the US, the UK, and the EU.

It can bring criminal charges for interception or unauthorized access, and the victim can also sue for damages. Guessing or tricking your way past a password does not make that access authorized.
Law enforcement and security research
Police and security agencies can use logging tools under warrants and court orders. Those powers come with strict paperwork and oversight that private people do not have.
Security researchers may test keyloggers on systems they own or are hired to test. Written permission from the system owner is what keeps that work legal.
These exceptions never cover private curiosity. A warrant or a signed testing agreement is a document, not a feeling, and you either have one or you do not.
Gray areas readers ask about
A shared family computer sits between the clear cases. If you own it, logging your own account is fine, but other adults in the home still hold rights over their own accounts and messages.
Helping an elderly parent works the same way. With their clear agreement, safety tools on their device are fine, but kind motives alone do not create consent.
School devices belong to the school. Schools set monitoring terms in their policies, and families accept those terms when they take the device home.
Renting or borrowing a device flips the ownership test. A laptop in your hands for one week is still someone else’s property, so the same consent rules apply in full.
Does the type of keylogger change the law?
Readers often ask whether a physical device is treated more lightly than an app. It is not. Interception and unauthorized access laws focus on the act, not on the tool used to do it.
A hardware dongle on a partner’s keyboard breaks the same rules as hidden software on their phone. The method changes the evidence trail, not the crime.
Legal vs illegal: common scenarios
The table below applies the principles to real situations. Treat the word usually as a warning label, because local law and small facts can still flip a row.

| Situation | Usually legal or illegal | Why |
|---|---|---|
| Logging your own laptop that only you use | Usually legal | You own the device and capture only your own data |
| A parent logging a young child’s tablet | Usually legal | Parental care on a device the parent owns |
| An employer logging a work laptop under a written policy | Usually legal | Company device, clear notice, and a work purpose |
| A school logging its own lab computers with notice | Usually legal | The school owns the devices and gives notice |
| A partner secretly logging a spouse’s phone | Usually illegal | No consent, and marriage gives no right to spy |
| Logging a friend’s or coworker’s computer | Usually illegal | No ownership and no consent |
Notice the pattern in the rows. Every legal row combines ownership with openness, and every illegal row is missing at least one of the two.
What to do if you were keylogged illegally
Keep the evidence. Do not delete the app or reset the device yet, because logs and install records may be needed for a report.
Report it to the police, and change your passwords from a clean device you trust. Our guide on how to detect a keylogger helps you confirm the logging, and a regular review of app permissions shows which apps can see too much.
Write down a timeline while it is fresh. Dates, devices, and who had access will help police and lawyers far more than guesses made later.
Then talk to a lawyer. A short consult can tell you whether to press charges, sue, or both, and how the evidence should be handled.
Before you use any keylogger: a decision checklist
Run through this checklist before you install anything. One wrong answer is enough to stop.
- I own the device, or I manage it with clear authority.
- Every adult user has been told, in plain words, before logging starts.
- I have a real, lawful reason, such as child safety or work security.
- The tool will capture only the data that reason justifies.
- I know the wiretap and computer misuse rules where I live.
- If any answer is no, I will stop and get local legal advice first.
The bottom line
The law does not fear the tool; it judges the hand that hides it. If you own the device, tell the user, and have a real reason, you are usually on safe ground.
When in doubt, ask one question out loud: would this logging survive being announced to the person it records? If the answer is no, do not install it.
Key takeaways
- Owning a keylogger is usually legal, but secret use on another adult is not.
- Ownership, consent, and notice decide most cases.
- Parents and employers have room to act when they are open about it.
- Marriage gives no right to spy on a partner.
- If you were logged without consent, keep the evidence and report it.
Frequently asked questions
Short answers to the questions readers ask most about keylogger law.
Is it legal to buy a keylogger?
In most places, yes. Shops can sell keyloggers and you can own one, much like other dual-use tools. The law steps in when you install it on a device that is not yours or record someone without consent.
Can I put a keylogger on my partner’s phone?
No, not in secret. An adult partner has a right to private messages, and marriage does not remove that right. Secret keylogging of a partner can lead to criminal charges and a civil claim.
Can my employer keylog a work laptop?
Often yes, within limits. Employers can usually monitor company-owned devices when staff know about it through a clear policy. Secret monitoring, or tracking a personal device, is far riskier and can break the law.
Can parents keylog a child’s device?
Usually yes, when the child is a minor and the device belongs to the parent. This is the most accepted use, but local rules and the child’s age matter. Open honesty is the safest approach as children grow.
What happens if I keylog a device I do not own?
You risk criminal charges for unauthorized access or interception, plus a civil claim from the victim. The exact law depends on your country, but no place treats spying on a partner’s or stranger’s device as lawful.
Is it legal to buy a keylogger?
In most places, yes. Shops can sell keyloggers and you can own one, much like other dual-use tools. The law steps in when you install it on a device that is not yours or record someone without consent.
Can I put a keylogger on my partner’s phone?
No, not in secret. An adult partner has a right to private messages, and marriage does not remove that right. Secret keylogging of a partner can lead to criminal charges and a civil claim.
Can my employer keylog a work laptop?
Often yes, within limits. Employers can usually monitor company-owned devices when staff know about it through a clear policy. Secret monitoring, or tracking a personal device, is far riskier and can break the law.
Can parents keylog a child’s device?
Usually yes, when the child is a minor and the device belongs to the parent. This is the most accepted use, but local rules and the child’s age matter. Open honesty is the safest approach as children grow.
What happens if I keylog a device I do not own?
You risk criminal charges for unauthorized access or interception, plus a civil claim from the victim. The exact law depends on your country, but no place treats spying on a partner’s or stranger’s device as lawful.
