If you are trying to send emails from applications like Python, Node.js, Outlook, php, Laravel or other programming language or third-party tools, you may have noticed that your normal Gmail password no longer works.
This is because Google has tightened security by disabling “Less Secure Apps”. Instead, you need to use an App Password.
Google gives us a safer option called an App Password. If you want to send or receive emails through an app or grammatically, you need to generate this special password.
In this guide, we’ll explain what an App Password is and how to generate an App Password for Gmail in simple steps.
What is an App Password?
An App Password is a 16-character passcode that gives third-party apps or devices secure access to your Google Account. Unlike your main Gmail password, it is generated by Google and can be revoked anytime.
For example:
- Connecting Gmail to mobile apps
- Sending emails using Python or Node.js
- Adding Gmail to Outlook or Thunderbird
The best part is, you can create different App Passwords for different apps and delete them anytime if you no longer use them.
Let’s generate app password for gmail step by step.
Turn On 2-Step Verification
As per google’s policy, you have to enable 2-Step Verification (also called two-factor authentication) on your Google account before you can generate an App Password.
Go to your Google Account Security Settings.
Under Signing in to Google, click 2-Step Verification.

Follow the steps to set it up using your phone number or Google Authenticator app.
Without this, you won’t see the option to create App Passwords.
Generate App Passwords
Once 2 factor authentication is enabled we can generate app password. To generate app password, search for app password or go to security page.
Under Signing in to Google, click on App Passwords. Google will again ask you for sign in to verify ownership. Once you enter your password it will redirect you to app password page.

It will ask to give name to application as per above image. Give name for app password as per your requirement and click on create button.
It will generate app password for you Gmail account and show it to you in popup window similar to below image.

Google will now show you a yellow box with a 16-character password. This is your new App Password. Copy this and store it somewhere safe. Google will not prompt it again.
Copy the App Password and paste it into your app instead of your regular Gmail password.
For example:
- In Python, you’ll use this code in your script.
- In Outlook, you’ll enter it when adding your Gmail account.
Conclusion
Now you know exactly how to generate an App Password for Gmail. This feature keeps your account safe while letting apps and devices access Gmail without using your real password.
Next time, You set up Gmail in Outlook, Thunderbird, or inside your code, remember to use an App Password instead of your main password.