Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • JS Tutorial
  • JS Exercise
  • JS Interview Questions
  • JS Array
  • JS String
  • JS Object
  • JS Operator
  • JS Date
  • JS Error
  • JS Projects
  • JS Set
  • JS Map
  • JS RegExp
  • JS Math
  • JS Number
  • JS Boolean
  • JS Examples
  • JS Free JS Course
  • JS A to Z Guide
  • JS Formatter
Open In App
Next Article:
Program to check Strength of Password
Next article icon

Create a Password Strength Checker using HTML CSS and JavaScript

Last Updated : 26 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

This project aims to create a password strength checker using HTML, CSS, and JavaScript that is going to be responsible for checking the strength of a password for the user's understanding of their password strength by considering the length of the password which will be that the password should contain at least 8 characters and the other is that the password should contain one uppercase letter, one lowercase letter, one number and one special character.

Prerequisites

  • HTML
  • CSS
  • JavaScript

Final Output

z9-min
Final Output

Approach

The password strength checker will be implemented using the following steps:

  • Create an HTML form that includes an input field for entering passwords using some tags that help to build the structure of the project <form>,<div>,<h>, etc.
  • Styling the project using the CSS some properties that are used border, margin, padding, etc.
  • Utilize JavaScript to analyze the characteristics of passwords and calculate their strengths.
  • Display the assessed strength of passwords using indicators such as colors or progress bars.
  • Provide users with feedback, about their password strength based on predefined criteria.

Project Structure

z5
Project structure

Example: This example describes the basic implementation of the Password Strength Checker using HTML, CSS, and JavaScript.

HTML
<!--index.html-->  <!DOCTYPE html> <html lang="en">  <head>     <meta name="viewport"            content="width=device-width,                     initial-scale=1.0" />     <link rel="stylesheet"            href="style.css" />     <script src="script.js"></script> </head>  <body>     <div class="group">         <h1 id="top">GeeksforGeeks</h1>         <h1>Password Strength Checker</h1>         <label for="">Password</label>         <input type="text"                 id="password"                placeholder="Type your password here" />         <label for="">               Strength of password           </label>         <div class="power-container">             <div id="power-point"></div>         </div>     </div> </body>  </html> 
CSS
/* style.css */  body {     margin: 0;     font-family: monospace;     min-height: 100vh;     display: flex;     justify-content: center;     align-items: center;     background-image: linear-gradient(to top right,             #7abb76, #cfd2d8);     color: #0e0f0f;     font-size: 20px; }  #top {     color: green; }  .group {     width: auto;     text-align: center; }  .group label {     display: block;     padding: 20px 0; }  .group input {     border: none;     outline: none;     padding: 20px;     width: calc(100% - 40px);     border-radius: 10px;     background-color: #eaeff2;     color: #3ba62f;     font-size: 20px; }  .group .power-container {     background-color: #2E424D;     width: 100%;     height: 15px;     border-radius: 5px; }  .group .power-container #power-point {     background-color: #D73F40;     width: 1%;     height: 100%;     border-radius: 5px;     transition: 0.5s; } 
JavaScript
// script.js  let password = document.getElementById("password"); let power = document.getElementById("power-point"); password.oninput = function () {     let point = 0;     let value = password.value;     let widthPower =          ["1%", "25%", "50%", "75%", "100%"];     let colorPower =          ["#D73F40", "#DC6551", "#F2B84F", "#BDE952", "#3ba62f"];      if (value.length >= 6) {         let arrayTest =              [/[0-9]/, /[a-z]/, /[A-Z]/, /[^0-9a-zA-Z]/];         arrayTest.forEach((item) => {             if (item.test(value)) {                 point += 1;             }         });     }     power.style.width = widthPower[point];     power.style.backgroundColor = colorPower[point]; }; 

Output:


Next Article
Program to check Strength of Password
author
zaidkhan15
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • Geeks Premier League
  • JavaScript-Projects
  • Geeks Premier League 2023

Similar Reads

  • Strong Random Password Generator Online
    This Strong Random Password Generator offers an invaluable understanding of the significance of strong passwords and provides strong Passwords with the power of a reliable password generator tool. This tool Allows users to define password length, and character types (uppercase, lowercase, numbers, s
    3 min read
  • Tips For Choosing a Strong Password
    Forgot your password?... Let’s reset with the whole concept. So what is your Password? PassWord PassssWord1 Paasword9876… or Names of favorite sports personalities, celebs, and even brands are used as passwords by so many people. And then random posts, messages, and comments from your account, getti
    5 min read
  • 5 Most Popular Methods Used By Hackers To Crack Password
    In today's world, almost еvеryonе has bank accounts, еmail and social mеdia accounts that rеquirе passwords to accеss. Howеvеr, many pеoplе еithеr storе thеir passwords on thе dеvicе or choosе wеak passwords that can bе еasily guеssеd. Hackеrs arе always trying to stеal passwords that give thеm acce
    6 min read
  • How to Remove Windows 10 Password?
    Looking to remove your Windows 10 password for a faster login experience? Whether you want to disable the password on Windows 10 or simply streamline the login process, this guide will walk you through the steps to turn off the Windows 10 login password. By following these easy steps, you'll learn h
    4 min read
  • How to Recover an Apple ID Password?
    Forgetting your Apple ID password can be a frustrating experience for users, especially considering how integral the Apple ID is to accessing various services like iCloud, the App Store, and Apple Music. Fortunately, recovering your Apple ID password is a straightforward process. This article will w
    6 min read
  • How to Change Computer Password?
    There are only a few people who don't use passwords on their Computer. User password is the most basic security check that helps you restrict unauthorized access to your computer. It's a good practice to change your passwords in a short span that helps your password to be healthy. By the end of this
    3 min read
  • Random password generator in C
    In this article, we will discuss how to generate a random password of a given length consists of any characters. Approach: The below-given program involves basic concepts like variables, data types, array, loop, etc.Follow the below steps to solve this problem:Take the length of the password and dec
    2 min read
  • Generating Strong Password using Python
    Having a weak password is not good for a system that demands high confidentiality and security of user credentials. It turns out that people find it difficult to make up a strong password that is strong enough to prevent unauthorized users from memorizing it. This article uses a mixture of numbers,
    3 min read
  • Create a Password Strength Checker using HTML CSS JS
    This project aims to create a password strength checker using HTML, CSS, and JavaScript that is going to be responsible for checking the strength of a password for the user's understanding of their password strength by considering the length of the password which will be that the password should con
    3 min read
  • Program to check Strength of Password
    A password is said to be strong if it satisfies the following criteria: It contains at least one lowercase English character.It contains at least one uppercase English character.It contains at least one special character. The special characters are: !@#$%^&*()-+Its length is at least 8.It contai
    5 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences