HTML Password Input Generator
WM-36Type a label and limits and copy a password input with its label. Pick current-password for sign-in forms and new-password for sign-up forms.
Runs in your browser. Nothing is uploaded.
Key: value lines (label: is required; also name:, placeholder:, minlength:, maxlength:, pattern:, size:, required:, readonly:, disabled:)
HTML
How to use it
- Write label: and optionally name:, minlength:, maxlength:, pattern:, placeholder: and required:.
- Choose the autocomplete value.
- Copy the label and input.
- Put it inside a form served over HTTPS.
autocomplete tells password managers what to do
On a sign-in form, autocomplete="current-password" tells a password manager to fill the saved password. On sign-up and change-password forms, "new-password" tells it to suggest a new one and not to fill an old one. Setting it to off is often ignored by browsers for password fields. The tool offers these as choices and writes the one you pick.
What type="password" does and does not do
The type only hides the characters on screen. It does not encrypt the value, so the form must be sent over HTTPS. There is no value: line in this tool on purpose, so a password cannot be written into markup. minlength and maxlength set limits that the browser checks on submit, and a pattern, once tested as a regular expression here, must match the whole value. Server-side checks are still needed.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Add a "label:" line. An input needs a visible label so screen readers can name it. | No label: line was found. | Add label: and the visible text. |
"minlength:" cannot be larger than "maxlength:". | The limits contradict each other. | Make minlength smaller than maxlength. |
Questions people ask
How do I add a password field in HTML?
Use an input of type password with a label and a name. Put it in a form that submits over HTTPS. Add autocomplete so password managers can help.
What is autocomplete new-password?
A hint that this field holds a password being chosen, so the browser or manager should suggest a strong one instead of filling an existing one. Use current-password for sign-in.
Can I set a minimum password length in HTML?
Yes, with minlength. The browser blocks submitting a shorter value and shows a message. It is a convenience for users, so repeat the rule on the server.
Is type=password secure?
It masks the characters on screen and nothing more. The data is sent as typed, so the page must use HTTPS, and the server must store only a salted hash of it.
Should I block pasting into password fields?
No. Blocking paste stops people from using password managers, which makes passwords weaker. This tool does not add any such script. Let people paste, and let their manager fill the field, since both help them use long unique passwords.
About this tool
Writes a label and an input of type password. Output is a label plus the control, joined by the for and id attributes; the id comes from an id: line, else the name, else the label. Use autocomplete="current-password" on a sign-in form and "new-password" on sign-up and change-password forms so password managers know what to do. A pattern is checked as a regular expression before it is written. There is deliberately no value: line, so the tool cannot write a password into your markup. The type only hides the characters on screen; it does not encrypt anything, so the form still needs HTTPS. Optional lines: id:, class:, title:, lang:, data-* and aria-*.