HTML <input> step Attribute

Last Updated : 26 May, 2026

The step attribute is used to specify the interval between valid values for an input field. It helps control the allowed increments in numeric and date-based inputs.

  • Defines the step interval for input values.
  • Commonly used with number, range, date, and time input types.
  • Prevents users from entering values outside the specified step pattern

Syntax:  

<input step = "value"> 

Attribute Values: It contains a value i.e number which specifies the legal number interval for the number field. It has a default value which is 1.

Example: Illustrates the use of step attribute in <input> element.

html
<!--Driver Code Starts-->

<!DOCTYPE html>
<html>

<head>
    <title>
      HTML input step Attribute
  </title>
</head>

<!--Driver Code Ends-->

<body>
  <center>
    <h1 style="color: green;"> 
            GeeksforGeeks 
        </h1>

    <h2> 
            HTML &lt;input&gt; step Attribute 
        </h2>

    <input type="number" 
           name="points" 
           step="5" 
           placeholder="multiples of 5">

  </center>
</body>

<!--Driver Code Starts-->

</html>

<!--Driver Code Ends-->
Comment