👀 Live Preview
Task progress at 60% with optimum 75 (target is higher):
Current: 60 — optimum: 75

The optimum attribute is used on the <meter> element to mark the preferred or ideal value on a gauge scale. Together with min, max, and value, it helps browsers show whether the current reading is in a good, medium, or poor zone (colors vary by browser). Use it for disk usage (lower is better), test scores (higher is better), or any measurement with a clear target. It is not form validation — it does not apply to input or progress. Set meter.optimum in JavaScript when the target changes.
One element.
Target point.
Scale bounds.
Current reading.
Browser hint.
JS property.
optimum AttributeThe primary purpose of optimum is to tell the browser where the ideal point lies on a <meter> scale. The browser compares value to optimum and may color the bar to suggest good vs suboptimal readings — without extra CSS or JavaScript.
Choose optimum based on what “good” means for your metric. For a test score out of 100, optimum="80" means 80% is the target. For disk usage, optimum="20" means low usage is preferred. Always pair with min, max, and value.
optimum does not validate user input or block form submission. It is a display hint for meter gauges only — unlike min or pattern on input elements.
Add optimum on a meter element with min, max, and value:
<label for="progress">Task progress:</label>
<meter
id="progress"
value="60"
min="0"
max="100"
optimum="75">
60%
</meter><meter> — not on progress or input.min and max (inclusive).min, max, and value on the same element.<meter> for browsers without support.meter.optimum = 90 (number).value sits relative to optimum.meter (measurement with range) with progress (completion).The optimum attribute accepts a numeric value on the meter scale:
optimum="75" with min="0" max="100" — 75 is the ideal target on a 0–100 scale.optimum="20" on disk usage — Lower usage is preferred (optimum near the low end).optimum="90" on a quiz score — Higher scores are preferred (optimum near the high end).<!-- Higher is better -->
<meter value="72" min="0" max="100" optimum="80">72%</meter>
<!-- Lower is better -->
<meter value="85" min="0" max="100" optimum="25">85% used</meter>| Attribute | Role on meter | Example |
|---|---|---|
min | Lowest scale value | 0 |
max | Highest scale value | 100 |
value | Current measurement | 60 |
optimum | Ideal / target value | 75 |
meter.optimum | JS property | meter.optimum = 90 |
progress | No optimum | Use meter instead |
| Element | Supported? | Notes |
|---|---|---|
<meter> | Yes | Only valid target |
<progress> | No | Completion bar — no optimum |
<input> | No | Use min / max for validation |
<div>, custom gauges | No | Native meter or CSS/JS charts |
Related: min, max, value | Yes | Required companions on meter |
optimum vs value vs progress| Concept | What it represents | Element |
|---|---|---|
value | Current measurement | meter, progress |
optimum | Ideal target on the scale | meter only |
min / max | Scale boundaries | meter, inputs, progress |
progress element | Task completion (0–100%) | No optimum attribute |
Task progress meter, dynamic meter.optimum, and lower-is-better vs higher-is-better gauges.
Task progress at 60% with optimum 75 (target is higher):
Current: 60 — optimum: 75
Show task progress with a target of 75%:
<p>Task progress:</p>
<meter
value="60"
min="0"
max="100"
optimum="75">
60 out of 100
</meter>value="60" is the current reading. optimum="75" marks 75 as the ideal target. The browser may color the bar to show 60 is below the target.
Update the optimum target at runtime:
<meter id="dynamicMeter" value="85" min="0" max="100">85%</meter>
<script>
document.getElementById("dynamicMeter").optimum = 90;
</script>The optimum IDL property accepts a number. Changing it updates how the browser interprets whether the current value is near the ideal point.
Place optimum near the low end or high end depending on the metric:
<!-- Disk usage: low is good -->
<meter value="85" min="0" max="100" optimum="25">85% used</meter>
<!-- Quiz score: high is good -->
<meter value="72" min="0" max="100" optimum="80">72%</meter>Where you place optimum on the scale signals whether lower or higher values are preferred. The browser uses that hint for meter coloring.
meter with a visible <label> or nearby heading.<meter> for older browsers.progress for known completion; meter for measurements against a range.min, max, value.
Ideal target.
value vs optimum.
Colored hint.
The optimum attribute on <meter> is supported in all modern browsers that support the meter element.
optimum on meterNative gauges with ideal-value hints in every major browser.
meter 99% supportedBottom line: Safe for native gauge displays in all modern browsers.
optimum only on meter with min, max, value<meter>meter.optimum when targets change in JSoptimum for form validationoptimum on progress or inputmin or max on the metermeter (measurement) with progress (completion)The optimum attribute marks the ideal value on a meter scale — helping browsers show whether the current reading is near your target.
Pair it with min, max, and value, choose the target thoughtfully for lower-is-better or higher-is-better metrics, and set meter.optimum in JavaScript when needed.
optimumBookmark these before adding meter gauges.
One element.
ScopeTarget point.
PurposeRequired trio.
PairDynamic target.
APIDisplay hint.
Gotchameter scale. Browsers use it with min, max, and value to suggest good vs suboptimal zones.<meter>. It does not apply to progress, input, or other elements.optimum is a display hint for gauges. Use min, max, or pattern on inputs for validation.meter.optimum = 90 — assign a number to the IDL property, or use setAttribute("optimum", "90").progress shows task completion toward a known total. meter shows a measurement within a range and supports optimum for an ideal target.meter in all modern browsers. Internet Explorer did not support the meter element.Practice the optimum attribute on meter with task progress and disk usage examples in the Try It editor.
5 people found this page helpful