</> ConvertAtlas Developer Tools
Bootstrap 5 · Intermediate

Password Strength Meter

A password field with a live Bootstrap progress-bar strength meter.

Requires Bootstrap 5. Add the CDN tags below to your page (styles in <head>, scripts before </body>). The downloaded file already includes them.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<div class="card border-0 shadow-sm" style="max-width:340px"><div class="card-body">
  <label class="form-label small fw-semibold">Password</label>
  <input type="password" class="form-control mb-2" id="pwInput" placeholder="Type a password">
  <div class="progress mb-1" style="height:6px"><div class="progress-bar" id="pwBar" style="width:0"></div></div>
  <small class="text-secondary" id="pwLabel">Strength</small>
</div></div>
var i=document.getElementById('pwInput'),bar=document.getElementById('pwBar'),lab=document.getElementById('pwLabel');
var C=['bg-danger','bg-warning','bg-info','bg-success'],L=['Weak','Fair','Good','Strong'];
i.addEventListener('input',function(){var v=i.value,s=0;if(v.length>=8)s++;if(/[A-Z]/.test(v)&&/[a-z]/.test(v))s++;if(/[0-9]/.test(v))s++;if(/[^A-Za-z0-9]/.test(v))s++;bar.className='progress-bar '+(C[s-1]||'bg-danger');bar.style.width=(v?Math.max(s,1)*25:0)+'%';lab.textContent=v?(L[s-1]||'Weak'):'Strength'});
Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.