Last updated: November 3, 2026.
Say the word hacker and most people picture a hoodie in a dark room. That image is mostly wrong. Hackers are sorted into types by what they do and why, not by what they wear.
There are six main types of hackers, split by a color-coded hat system: white hat (ethical and authorized), black hat (criminal and unauthorized), grey hat (unauthorized but not malicious), red hat (vigilantes who go after black hats), blue hat (outside testers hired before a product launch) and green hat (beginners still learning). The hat color describes intent and legal standing. It says nothing about raw skill.
Key takeaways
- The one line that separates a legal hacker from a criminal is permission.
- Good intentions are not a legal defense. A grey hat who means well can still be prosecuted.
- Black hats are the group you need to defend against, and most of their attacks start with a person being tricked, not a technical break-in.
- Newer labels such as script kiddies, hacktivists, state-sponsored hackers and insider threats describe role or funding, not hat color.
You will see this topic called types of hackers, kinds of hackers, hacker categories or hacker hats. The six colors below cover the core ones.
Where the Hacker Hat Idea Comes From
The hat system borrows from old Western films, where the hero wore a white hat and the villain a black one. Security researchers adopted the metaphor decades ago because it is a handy shorthand for intent: white for good, black for bad and everything else in between.
The 6 Types of Hackers at a Glance
| Hat color | Legal? | Motivation | Real-world example |
|---|---|---|---|
| White hat | Yes, with permission | Find and fix flaws | Paid penetration testers |
| Black hat | No | Money, damage, data theft | Ransomware gangs |
| Grey hat | Usually not, but not malicious | Curiosity, recognition | Unpaid bug hunters who alert companies |
| Red hat | Legally gray, often aggressive | Stop black hats directly | Vigilante counter-hackers |
| Blue hat | Yes, contracted | Test a product before release | External security consultants |
| Green hat | Neither, still learning | Build skills | Hacking students and hobbyists |
White Hat Hackers
White hat hackers, also called ethical hackers, break into systems with the owner’s written permission to find weaknesses before criminals do. Companies hire them directly, work with them through bug bounty programs or bring them in as independent penetration testers.
A white hat engagement starts with a signed agreement, often called a scope of work, that spells out what can be tested and what is off limits. Without that permission, the exact same actions would be illegal. The technique does not change, only the authorization does. In one line: authorized access, good intent, always with consent.
Famous White Hat Hackers
- Kevin Mitnick was once one of the FBI’s most-wanted hackers. After prison, he built a legitimate security consulting career and wrote about social engineering. He died in 2023.
- Charlie Miller is a security researcher known for finding and reporting serious vulnerabilities in Apple products and for demonstrating attacks on connected cars.

Black Hat Hackers
A black hat hacker breaks into systems without permission, for personal gain or to cause harm. The black hat hacker meaning is the opposite of white hat: no authorization, no consent and usually a criminal motive.
Common motivations include:
- Financial gain: stealing card numbers and bank details, or deploying ransomware for a payout.
- Data theft: taking sensitive information to sell or use for identity theft.
- Disruption: taking down websites or services, sometimes with DDoS attacks.
- Espionage: stealing trade secrets or classified information.
Typical techniques include phishing emails, malware, exploiting unpatched vulnerabilities and social engineering, which means tricking a real person into handing over access instead of breaking in technically.
Grey Hat Hackers
Grey hat hackers (also written greyhat) sit between white and black. They access a system without permission, which is technically illegal, but without the intent to steal, damage or profit.
A typical grey hat scenario: someone finds a security flaw on a company’s website without being asked to look, then reports it, sometimes hoping for a reward or public credit. They did not have authorization, so it is not clean white hat work, but they did not cause harm either. That legal grey area is where the name comes from, and why companies respond so differently. Some say thank you, others call the police.
Red Hat Hackers
Red hat hackers are the vigilantes. They actively go after black hat hackers with aggressive, often equally illegal methods, such as infecting a criminal’s system with malware or knocking their servers offline. This is not defense in the way white hat work is. It is direct retaliation, and it puts red hats in an odd legal position: they target criminals, but their own methods usually break the same laws.
Blue Hat Hackers
The term blue hat has two meanings, and mixing them up is a common mistake.
- The professional meaning comes from Microsoft’s BlueHat security conferences: an outside security expert hired to test software for bugs before it ships. It is a contracted, legal job.
- The older, informal meaning is an amateur who attacks a system out of personal revenge.
Green Hat Hackers
Green hat hackers are newcomers. They lack deep skills for now but are actively learning by following tutorials, joining forums and asking experienced people. They are not the same as script kiddies: a green hat wants to understand how an attack works, not just run someone else’s tool.
Beyond the 6 Hats: Other Types of Hackers
- Script kiddies: inexperienced attackers who run tools built by others without understanding them.
- State-sponsored hackers: funded and directed by a government, usually targeting other governments or critical infrastructure.
- Hacktivists: motivated by a political or social cause rather than money.
- Insider threats: employees or contractors who misuse access they already have.
These labels describe a role or funding source rather than a hat color, so a state-sponsored hacker can also use black hat methods.
Is Hacking Legal? White Hat vs Black Hat
In the United States, the Computer Fraud and Abuse Act, codified at 18 U.S.C. 1030, makes unauthorized access to protected computers illegal. Intent mostly affects how serious the penalty is, not whether a crime occurred. That is why legitimate white hat work always starts with a signed contract. For a related legal topic, see our guide to whether doxxing is illegal.
What Skills Does a Hacker Need?
Skilled hackers of any hat tend to share the same profile: strong knowledge of networks and operating systems, comfort reading and writing code, and curiosity about how systems break. What sets a professional white hat apart is the framework around those skills: legal training, a code of ethics and often a recognized certification such as CEH (Certified Ethical Hacker) or OSCP (Offensive Security Certified Professional).
How to Protect Yourself From Black Hat Hackers
Most attacks on ordinary people succeed through simple mistakes, so a few habits cover a lot:
- Use a password manager and unique passwords. See how to protect your data online with a password manager.
- Install updates promptly, because attackers exploit known flaws. We explain why in our guide to software update benefits.
- Be suspicious of urgent messages asking you to click, pay or log in. That is phishing and social engineering.
- Limit what strangers can find about you. Our guide to removing your information from the internet shows how.
Frequently Asked Questions
What is the difference between white hat and black hat hacking?
Permission and intent. White hat hackers have explicit authorization and aim to help. Black hat hackers have neither.
Is grey hat hacking illegal?
Yes, because it happens without permission, even when the hacker means well and causes no harm.
What are the 6 types of hackers?
White hat, black hat, grey hat, red hat, blue hat and green hat, categorized by intent and authorization rather than skill.
What is a script kiddie?
An inexperienced attacker who uses ready-made tools without understanding how they work.
Can you become a hacker legally?
Yes. Many people become ethical hackers through study, home labs, certifications and bug bounty programs, always working only on systems they have permission to test.
What is the most dangerous type of hacker?
There is no single answer. Well-funded state-sponsored groups and organized ransomware gangs cause the most damage, but a careless insider can be just as costly.
The Bottom Line
Six hat colors, one real distinction: permission. White and blue hats have it. Black, grey and red hats do not, even when a grey or red hat’s goal is arguably good. Green hats have not picked a side yet. They are still learning the craft that every other hat depends on.
Sources
- Cornell Law School: 18 U.S.C. 1030, Computer Fraud and Abuse Act
- Wikipedia: Kevin Mitnick
- Wikipedia: Charlie Miller
This article is for general information and is not legal advice.




[…] from the hardware being hacked. Many of those attacks start with phishing, so it helps to know the types of hackers and how they […]
[…] The federal cases show how serious it can get. In 2022, a Long Island woman pleaded guilty to conspiracy to commit mail, wire and bank fraud over companies that claimed to publish biographical reference books, in a scheme reported to have taken more than $1.5 million from older people. That case is unrelated to Marquis, but it shows how a directory pitch can be used for fraud. Scam emails like these are also a common route for phishing and social engineering. […]
[…] The same idea explains why attackers who get inside a building are so hard to stop. Our guide to types of hackers covers the insider and social engineering threats that cages are meant to slow […]