Key Takeaways
With min=0, no step and no initial value attribute, 3.5 produces stepMismatch. Use step=0.5 for an intended half-unit increment. With min=0.2 and step=1, 3.2 fits while 3.5 does not. step=any removes the increment constraint, while min, max and business rules remain.
- Step size and its base both matter; inspect min and the initial value attribute.Read the supporting section: Separate range from permitted increments
- Six browser cases distinguish stepMismatch from rangeOverflow without depending on a localized message.Read the supporting section: Inspect six isolated controls
- Change step only when fractions are intended; frontend validity does not establish server acceptance.Read the supporting section: Change the intended rule, then recheck
In this article
Separate range from permitted increments
The step reference describes the base for a number input: min takes precedence, then the value attribute, otherwise usually zero. This article does not apply date/week exceptions to number inputs. A control’s current value and its initial HTML value attribute are different.
A default step does not necessarily mean integers only. With min=0.2 and step=1, the sequence includes 0.2, 1.2, 2.2 and 3.2. Changing min can alter both the range and the base; do not change a business minimum merely to remove a message.
Inspect six isolated controls
On December 1, 2026, the editor created controls in an isolated Edge 158.0.4370.45 context, set their constraints and then assigned current values. None had an HTML value attribute. These were local validity checks without submitting a form to any website.
| min | step | Current value | Result |
|---|---|---|---|
| 0 | Omitted; defaults to1 | 3.5 | stepMismatch=true |
| 0 | 0.5 | 3.5 | Valid |
| 0.2 | 1 | 3.2 | Valid |
| 0.2 | 1 | 3.5 | stepMismatch=true |
| 0.2 | any | 3.5 | Valid |
| 0; max=10 | any | 11 | rangeOverflow=true; stepMismatch=false |
Change the intended rule, then recheck
If the quantity must be whole items, retain the increment and ask for a different value. Set step=0.5 only when half units are intended. Use any for unrestricted increments only when appropriate, preserving separate range, precision and business checks. Hiding the message does not repair a contract.
The ValidityState reference identifies increment, range and missing-value flags separately. On your own test page, give the control id="quantity" and inspect it with the following record. Browser language can change the displayed error message.
const input = document.querySelector("#quantity");
console.table({
value: input.value,
min: input.min,
step: input.step,
stepMismatch: input.validity.stepMismatch,
rangeOverflow: input.validity.rangeOverflow,
valid: input.checkValidity()
});Separate a valid control from successful submission
The frontend-validation guide explains why servers still need validation. An optional empty field may not fail a step constraint. An accepted quantity does not prove permission, available stock or a completed save.
For a keyboard barrier, record the route with the focus and keyboard checks. Preserve exact attributes and reproduction inputs using the HTML/code-content checks. This specimen is not a site-wide accessibility or business-security certification.


