# Apple Password Rules

TIL you can use the `passwordrules` HTML attribute to tell password managers how to generate passwords for you.

Here's an example:
```html
<input type="password" passwordrules="minlength: 20; required: lower; required: upper; required: digit; required: [-];" />
```

More info on [Apple's passwordrules demo site](https://developer.apple.com/password-rules) and on [Apple's documentation site](https://developer.apple.com/documentation/security/customizing-password-autofill-rules). There's a [WHATWG](https://github.com/whatwg/html/issues/3518) proposal to standardize this across browsers. It was deadlocked for a long time, with Mozilla being against it, but as of March 2025, [Mozilla's position is now positive](https://github.com/mozilla/standards-positions/issues/61).

Regardless, there's no harm in using it, and it can only help users who use password managers that support it.
