New in HTML5.

<input min="">

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Attribute of
How To Use Input To Create Form Fields In HTML: Easy Tutorial
What does <input min=""> do?
Specifies a minimum value for number and date input fields.

Code Example

<form>
 <label for="hours">How many hours are you available to work each week?</label><br>
 <input type="number" id="hours" name="hours" min="15">
</form>

<!-- Try putting in 10 and pressing enter. -->

The min attribute and data validation

The min attribute works on <input> elements of the numeric or date type. It provides you a Javascript-free form of light-weight form data validation — user inputs below the minimum are not accepted by the form. However, it is important to remember that this is not a sufficient data validation technique. Using the min attribute, like all other HTML-based data validation, should be thought of as helpful to the user, more than helpful to you as a developer. Because of the way forms work, it is still possible for malicious users (or users with old browsers, even) to provide data outside the range specified by the min and max attributes. So you will still need to handle data validation (and sanitization) on the server.

Adam is a technical writer who specializes in developer documentation and tutorials.

Browser Support for min

iefirefoxchromeedgesafariopera
10434513934