HTML min Attribute

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The min attribute sets the lowest allowed value for an <input>. If the current value is below min, the control fails constraint validation (rangeUnderflow) and matches :invalid / :out-of-range. It must be less than or equal to max when both are set.

Valid on number, range, date, time, datetime-local, month, and week. Also sets the lower bound of a <meter> (default 0 if omitted). For text length, use minlength instead.

Baseline · Widely available.

Not deprecated and not experimental. Stable across modern browsers since about July 2015.

Client validation only.

Users can bypass browser checks. Always enforce the same minimum on the server.

HTML Syntax

syntax.html
<input type="number" min=" value">
<meter min=" number" max="number" value="number">

The format of value depends on the input type (number, date string, time string, and so on).

Attribute Values

Match the value format to the control type:

Type / elementValue formatTry it
number, rangeA number, e.g. min="1" or min="0.5"Try it
dateyyyy-mm-dd, e.g. min="2026-01-01"Try it
timeHH:mm, e.g. min="09:00"Try it
datetime-localyyyy-mm-ddTHH:mmTry it
month / weekyyyy-mm or yyyy-W##Try it
<meter>Lower numeric bound of the gauge (default 0)Try it

Live Preview

Change min on a number field, then try values below and above the limit.

Submit is blocked when the value is below min. Validity updates as you type.

Number input

min="1" — valid

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Number Input Lower Limit

Require a quantity of at least 1.

HTML
<label for="qty">Quantity (min 1):</label>
<input type="number" id="qty" name="qty" min="1" max="99" value="1" required>
Try It Yourself

How It Works

  1. min="1" sets the lowest allowed number.
  2. Pair with max when you also need an upper cap.
  3. Below min fails validation (rangeUnderflow) on submit or check.
  4. Label the control so users know the minimum before they type.

Example 2 — Date Input Earliest Day

Block dates before a chosen day with a yyyy-mm-dd minimum.

HTML
<label for="start">Start date:</label>
<input type="date" id="start" name="start" min="2026-01-01" required>
Try It Yourself

How It Works

  1. Use the type’s format. For date, min must be yyyy-mm-dd.
  2. Picker respects the bound in supporting browsers.
  3. Same idea for time types — e.g. min="09:00" on type="time".
  4. Tell the user the earliest allowed date in the label or help text.

Example 3 — Meter Lower Bound

On <meter>, min defines the bottom of the measured scale.

HTML
<label for="score">Score:</label>
<meter id="score" min="0" max="100" low="40" high="80" value="72">
  72 out of 100
</meter>
Try It Yourself

How It Works

  1. min is the scale floor (defaults to 0 if omitted).
  2. max is the ceiling; keep min ≤ value ≤ max.
  3. Fallback text inside <meter> helps when the gauge UI is missing.
  4. Not a form validator like on <input> — it displays a measurement.

Edge Cases & Pitfalls

Most issues come from mixing up min with minlength, or forgetting how step interacts.

compare

Do not confuse with minlength

min is for numeric/date values. minlength is for character count on text fields.

step

min + default step can reject “in range” values

With min="7.2" and default step="1", 8 is invalid; valid steps are 7.2, 8.2, … Set step explicitly when needed.

format

Use the correct string format

Dates need yyyy-mm-dd, times HH:mm, and so on. An invalid min string means no minimum is applied.

range

Keep min ≤ max

If min is greater than max, the allowed range is broken. Always order the bounds correctly.

a11y

Explain the minimum to users

Put the rule in the label or help text (or aria-describedby). Do not rely on the browser error alone.

Browser Support

min is an HTML attribute for inputs and meter in the browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

min

Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support min on number, range, date/time inputs, and meter.

96% Global support (approx.)
Google Chrome 5+
Full support
Mozilla Firefox 16+
Full support
Apple Safari 5+
Full support
Microsoft Edge 12+
Full support
Opera 12.1+
Full support
Samsung Internet 4+
Full support
Internet Explorer 10+
Supported
min Widely supported

Bottom line: Safe to use for client-side lower bounds. Always re-check values on the server.

Key Takeaways

  • Role: set the lowest allowed numeric or date/time value.
  • Elements: number/range/date-like inputs and <meter>.
  • Not minlength: character minimums use minlength.
  • With step: valid values follow the min + step grid.

One line: min is the floor for values — not for text length.

Frequently Asked Questions

It sets the lowest allowed value for number, range, date, time, datetime-local, month, and week inputs, and the lower bound of a meter. Values below min fail constraint validation (rangeUnderflow).
No. min limits numeric or date/time values. minlength limits how many characters a text field must contain.
input types number, range, date, time, datetime-local, month, and week, plus the meter element. It does not apply to text, email, or checkbox inputs.
Yes. When both are set, min must be less than or equal to max, or the range is invalid.
Valid values are based on min and step. If step is omitted it defaults to 1 for number and range, so a value can fail validation even when it is above min.
No. It is client-side validation only. Always enforce the same minimum on the server.

Next: minlength

Require a minimum number of characters in text fields.

minlength tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful