Support0

HTML meter playground

Explore meter with controls for the current value, total range, and low, high, and optimum thresholds of a known scalar measurement.

Ask AI

HTML meter playground

Response generated with openai/gpt-5.4-nano. AI can make mistakes. Always review the result.
62/100 62/100
low
35
high
75
optimum
90
value
62/100
HTML
<label for="baseline-meter">Storage usage</label>
<meter
  id="baseline-meter"
  min="0"
  max="100"
  low="35"
  high="75"
  optimum="90"
  value="62"
>
  62/100
</meter>

Educational guide to <meter>

Represent measurements within a known range

Represent a measurement within a known range. Learn to define its bounds, interpret low, high, and optimum, and accompany the gauge with a label and an understandable value.

Mental model

Position shows how much; thresholds help interpret that value.

  1. Range

    min and max define the known scale.

  2. Reading

    value places the measurement on that scale.

  3. Interpretation

    low, high, and optimum identify the preferable region.

The bar does not track a taskStatic diagram: define the scale, place the reading, then explain its meaning. The following examples render real meter elements.

meter presents data; it does not let you edit it. It suits used capacity, remaining battery, or a score with a defined maximum. The reading can rise or fall without representing completed work. A number without a meaningful maximum needs text or another visualization, rather than an invented range.

Range and value

The scale does not always start at zero or represent a percentage.

min defaults to 0 and max to 1. Use value="0.62" for a 62% fraction, or declare max="100" when your data uses a 0–100 scale. value must lie between min and max; numeric attributes use a decimal point and contain neither units nor a % sign. For a useful scale, set max greater than min.

A fraction with the default bounds

62%

62% used: a fraction of 0.62 on a scale from 0 to 1.

value=0.62 occupies 62% of the 0–1 range. Visible text preserves the percentage independently of the bar.
A fraction with the default bounds
<div class="meter-guide-scene">
  <label for="meter-guide-fraction">Fraction of storage used</label>
  <meter id="meter-guide-fraction" value="0.62" aria-describedby="meter-guide-fraction-text">
    62%
  </meter>
  <p id="meter-guide-fraction-text">62% used: a fraction of 0.62 on a scale from 0 to 1.</p>
</div>
.meter-guide-scene {
  display: grid;
  gap: 1rem;
  min-inline-size: 0;

  meter {
    inline-size: min(100%, 20rem);
    block-size: 1.5rem;
  }

  p {
    margin: 0;
  }
}

A scale starting below zero

18 °C

18 °C on a scale from −20 to 40 °C.

18 °C is approximately 63.3% of the way from −20 to 40 °C. It is not 18/40: position is calculated from the minimum.
A scale starting below zero
<div class="meter-guide-scene">
  <label for="meter-guide-temperature">Measured temperature</label>
  <meter
    id="meter-guide-temperature"
    min="-20"
    max="40"
    value="18"
    aria-valuetext="18 °C"
    aria-describedby="meter-guide-temperature-text"
  >18 °C</meter>
  <p id="meter-guide-temperature-text">18 °C on a scale from −20 to 40 °C.</p>
</div>
.meter-guide-scene {
  display: grid;
  gap: 1rem;
  min-inline-size: 0;

  meter {
    inline-size: min(100%, 20rem);
    block-size: 1.5rem;
  }

  p {
    margin: 0;
  }
}

Relative position is (value − min) / (max − min). HTML accepts negative and fractional numbers; this playground limits its controls to nonnegative integers by design. If value is missing or invalid, the browser starts at 0 and clamps it to the range; it also clamps out-of-range readings to the bounds. That correction does not validate your data: check the source and show a textual state when no reliable measurement is available.

low, high, and optimum

A high number is not always good news.

low and high separate three regions, maintaining min ≤ low ≤ high ≤ max. They do not change the full scale or implicitly represent percentages. optimum identifies the preferable region: below low favors low readings; above high favors high readings; between them, including the boundaries, favors the middle region.

One reading, three interpretations

20/100

20 out of 100: the preferable low region.

20/100

20 out of 100: the low region, outside the preferable middle region.

20/100

20 out of 100: the low region, furthest from the preferable high region.

All three gauges have value=20, low=25, and high=75: their position is identical. Setting optimum to 10, 50, or 90 changes the interpretation, also written below each bar. Actual colors depend on the browser.
One reading, three interpretations
<div class="meter-guide-scene">
  <label for="meter-guide-lower">Preference for low values (optimum=10)</label>
  <meter
    id="meter-guide-lower"
    min="0"
    max="100"
    low="25"
    high="75"
    optimum="10"
    value="20"
    aria-describedby="meter-guide-lower-text"
  >20/100</meter>
  <p id="meter-guide-lower-text">20 out of 100: the preferable low region.</p>
  <label for="meter-guide-middle">Preference for middle values (optimum=50)</label>
  <meter
    id="meter-guide-middle"
    min="0"
    max="100"
    low="25"
    high="75"
    optimum="50"
    value="20"
    aria-describedby="meter-guide-middle-text"
  >20/100</meter>
  <p id="meter-guide-middle-text">20 out of 100: the low region, outside the preferable middle region.</p>
  <label for="meter-guide-higher">Preference for high values (optimum=90)</label>
  <meter
    id="meter-guide-higher"
    min="0"
    max="100"
    low="25"
    high="75"
    optimum="90"
    value="20"
    aria-describedby="meter-guide-higher-text"
  >20/100</meter>
  <p id="meter-guide-higher-text">20 out of 100: the low region, furthest from the preferable high region.</p>
</div>
.meter-guide-scene {
  display: grid;
  gap: 1rem;
  min-inline-size: 0;

  meter {
    inline-size: min(100%, 20rem);
    block-size: 1.5rem;
  }

  p {
    margin: 0;
  }
}

When omitted, low defaults to min, high to max, and optimum to the range midpoint. optimum must lie between min and max; it is neither a progress target nor a form validation constraint. When it sits in an outer region, the middle is less favorable and the opposite end is the least favorable. When it sits in the middle, both ends are less favorable. Define these criteria for your data domain and avoid treating “green” as a universal guarantee.

Label and text alternative

Name the measurement and show its value, units, and interpretation.

Associate label for with the meter id to name what is being measured. Native attributes provide the range and value: there is no need to duplicate them with role="meter" or aria-valuenow/min/max. When an announced percentage would not express the data well, aria-valuetext supplies units; aria-describedby connects further explanation. Check the result with your target assistive technologies.

Used capacity with a written warning

85 GB / 100 GB

85 out of 100 GB used. High usage: review the available space.

The label identifies storage. The reading uses GB, and a visible sentence states high usage and a possible action. The information remains available if colors change or the bar is not rendered.
Used capacity with a written warning
<div class="meter-guide-scene">
  <label for="meter-guide-storage">Storage used</label>
  <meter
    id="meter-guide-storage"
    min="0"
    max="100"
    low="25"
    high="75"
    optimum="10"
    value="85"
    aria-valuetext="85 GB / 100 GB"
    aria-describedby="meter-guide-storage-text"
  >85 GB / 100 GB</meter>
  <p id="meter-guide-storage-text">85 out of 100 GB used. High usage: review the available space.</p>
</div>
.meter-guide-scene {
  display: grid;
  gap: 1rem;
  min-inline-size: 0;

  meter {
    inline-size: min(100%, 20rem);
    block-size: 1.5rem;
  }

  p {
    margin: 0;
  }
}

Content between the tags is fallback text, normally hidden when the gauge renders. It replaces neither label nor an always-visible textual reading. Put the information everyone needs outside meter and associate it when it adds context. Do not rely solely on color, a title tooltip, or a CSS pseudo-element to explain the state.

meter is a readout, not a keyboard-adjustable control. It needs no tabindex, arrow listeners, or simulated buttons. To let someone choose a value, use a labeled range or number input. If an application updates the measurement, keep its text synchronized; reserve status announcements for relevant changes instead of announcing every fluctuation.

Measurement versus progress

The meaning of the data determines the element, even when the bars look similar.

meter: “what is the current level?” For example, 85 GB used out of a 100 GB capacity. There is no task that should reach 100%, and low/high/optimum can help interpret the level.

progress: “how much work is complete?” For example, 85 out of 100 files uploaded. When a task is active but the amount completed is unknown, progress without value represents an indeterminate state. Removing value from meter does not create that state.

For a quantity without useful bounds, show text with units or another suitable chart. To edit data, use an input. A bar appearance does not make these meanings interchangeable; semantics should match the person’s question.

Common pitfalls

Check the scale and meaning before customizing appearance.

The bar looks full with value=62

Expected result
Show a 62% reading.
Cause
max is omitted, so the range ends at 1; the browser clamps 62 to the maximum.
Solution
Use value=0.62 or declare min=0 and max=100. Keep units and the percentage in text.

A high level incorrectly appears favorable

Expected result
Explain that high usage is less favorable.
Cause
optimum is placed at the high end although the data represents used capacity.
Solution
Define the preferable region for the data; for lower usage, place optimum below low. Also write the state in text.

Only a colored bar is visible

Expected result
Understand the measurement, number, and meaning without distinguishing colors.
Cause
Information is left inside meter or in title, with no associated label.
Solution
Add label and visible text with units; connect the explanation with aria-describedby and use aria-valuetext when helpful.

A loading task is presented as a measurement

Expected result
Communicate completed work or activity without a known percentage.
Cause
meter is chosen for its appearance and value is removed to try to simulate indeterminate activity.
Solution
Use progress for tasks. On meter, a missing value produces a default value clamped to the range.

Support and compatibility

Element support does not guarantee identical appearance or assistive output.

meter is Baseline Widely Available in major browsers. This does not include every WebView: BCD still records the element as unsupported in Android WebView at the stated consultation date. Rendering, colors, and announced details can vary by browser, system, and assistive technology; test your actual targets.

These examples preserve native appearance and need no JavaScript, polyfills, or browser-specific pseudo-elements. Visible text offers an alternative reading and internal content provides basic fallback text. Customizing the bar with prefixed selectors is another compatibility layer and should not remove semantics or hide the value in forced colors.