Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL SQLITE MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST DART PLAYWRIGHT TOOLS MATH SHEETS POWER BI

HTML Tutorial

HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Styles HTML Project I HTML Formatting HTML Quotations HTML Comments HTML Colors HTML CSS HTML Project II HTML Links HTML Images HTML Favicon HTML Page Title HTML Tables HTML Lists HTML Project III HTML Block & Inline HTML Div HTML Classes HTML Id HTML Project IV HTML Global Attributes HTML Buttons HTML Iframes HTML JavaScript HTML File Paths HTML Head HTML Layout HTML Responsive HTML Project V HTML Computercode HTML Semantics HTML Project VI HTML Dialog HTML Details HTML Style Guide HTML Entities HTML Symbols HTML Emojis HTML Character Sets HTML Languages HTML URL Encoding HTML Performance HTML SEO

HTML Forms

HTML Forms HTML Form Attributes HTML Form Elements HTML Input Types HTML Input Attributes Input Form Attributes HTML Form Validation HTML Progress and Meter HTML Project VII

HTML Graphics

HTML Canvas HTML SVG

HTML Media

HTML Media HTML Video HTML Audio HTML YouTube HTML Project VIII

Web Accessibility

Web Accessibility ARIA Attributes Keyboard Focus and tabindex Landmarks Skip Links Color Contrast

Web APIs

Web APIs Geolocation API Drag and Drop API Popover API Web Storage API Web Workers API Server-Sent Events API

HTML Cert

HTML Certificate

HTML Examples

HTML Examples HTML Videos HTML Editor HTML Quiz HTML Exercises HTML Challenges HTML Projects HTML Website HTML Syllabus HTML Study Plan HTML Interview Prep HTML Summary

HTML References

HTML Tag List HTML Attributes HTML Global Attributes HTML Browser Support HTML Event Attributes HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets HTML URL Encode HTML Language Codes HTML Country Codes HTTP Status Codes HTTP Request Methods PX to EM Converter Keyboard Shortcuts

HTML Progress and Meter


Share

Two Kinds of Bars

HTML has two elements that show a value as a bar:

  • <progress> shows how much of a task is done, like a download progress
  • <meter> shows a measurement within a known range, like disk usage or a test score

The browser draws both bars for you. you do not need any images or CSS.


The <progress> Element

The <progress> element shows how far a task has come.

The value attribute defines how much of the task is done, and max is the total:

Example

<label for="file">Downloading file:</label>
<progress id="file" value="70" max="100">70%</progress>
Try it Yourself »

In the example above, the bar is 70% full.

The text between the tags (70%) is shown only by very old browsers that do not support the element.

Tip: Always use a <label>, so screen reader users know what the bar is about.

A Progress Bar Without a Value

Sometimes you do not know how long a task will take.

Leave out the value attribute, and the browser shows a moving bar that means "working on it":

Example

<label for="loading">Loading:</label>
<progress id="loading" max="100"></progress>
Try it Yourself »


Update a Progress Bar

A progress bar is most useful when it is live, and changes.

A JavaScript can change the value while the task goes on:

Example

<progress id="steps" value="0" max="5">0 of 5</progress>

<button onclick="nextStep()">Next step</button>

<p id="status">0 of 5 steps done.</p>

<script>
function nextStep() {
  var bar = document.getElementById("steps");
  if (bar.value < bar.max) {
    bar.value = bar.value + 1;
  }
  document.getElementById("status").innerHTML = bar.value + " of 5 steps done.";
}
</script>
Try it Yourself »

In the example above, each click fills one more part of the bar. After five clicks, the page shows:

5 of 5 steps done.

The <meter> Element

The <meter> element shows a value within a known range, like disk usage or a test score.

Use min and max to set the range.

If you leave them out, the range is from 0 to 1:

Example

<label for="disk">Disk usage:</label>
<meter id="disk" value="0.6">60%</meter>

<label for="score">Test score:</label>
<meter id="score" value="7" min="0" max="10">7 out of 10</meter>
Try it Yourself »

Good, Okay, and Bad Values

A meter can show if a value is good or bad.

The low and high attributes split the range into three parts.

The optimum attribute tells the browser which part is the best:

Example

<meter value="90" min="0" max="100" low="20" high="80" optimum="100">90%</meter>
<meter value="50" min="0" max="100" low="20" high="80" optimum="100">50%</meter>
<meter value="10" min="0" max="100" low="20" high="80" optimum="100">10%</meter>
Try it Yourself »

This is a battery level, where a full battery is best.

  • 90% is above high, near the best value, so the bar is green
  • 50% is between low and high, so the bar is yellow
  • 10% is below low, far from the best value, so the bar is red

Note: The colors and the look of the bars can be different in each browser.

Always show the number as text too, so the value is clear without the color.


Use progress or meter?

  <progress> <meter>
Shows How much of a task is done A measurement within a range
Changes over time Yes, it moves toward the end Not usually
Can show good or bad values No Yes, with low, high, and optimum
Good for Downloads, uploads, steps in a form Disk usage, battery level, test scores

A simple rule: If something will be finished at some point, use <progress>.

If you are measuring something, use <meter>.


Summary

  • <progress> shows how much of a task is done, with value and max
  • A progress bar without a value shows that something is working
  • <meter> shows a value within a range, with min and max
  • low, high, and optimum mark values as good, okay, or bad
  • Always add a label, and show the number as text

HTML Tag Reference

Tag Description
<progress> Shows how much of a task is done
<meter> Shows a measurement within a known range

For a complete list of all available HTML tags, visit our HTML Tag Reference.


Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by W3Schools. All Rights Reserved. W3Schools is Powered by W3.CSS.