Read your coverage report and get the shields.io markdown for a badge, coloured by the same thresholds a hosted coverage service would use.
Waiting for a coverage report
Paste an LCOV or Istanbul report and the badge markdown appears here.
The colour thresholds are the ones shields.io itself applies to coverage, so this badge matches what a hosted service would produce for the same number. Two badges in one README disagreeing about whether 72% is yellow is worse than either being wrong.
Paste a coverage report to get the markdown for a badge.
This badge has the number baked into its URL, so it shows the coverage of the report you pasted and will not change when your code does. On a release tag that is accurate; on a default branch it will quietly claim a figure from whenever it was generated. Regenerate it in CI, or use a service that reads the report on each run.
Coverage Badge Generator runs entirely on your device — the badge URL is assembled in your browser and your report is never uploaded.
You’re on the Free plan. Compare plans
A coverage badge in a README is a one-line summary of how well tested a project is, and getting one usually means signing up to a service that reads your coverage uploads. If the number only needs to be right at release time, the badge can be generated from the report you already have.
The colour thresholds are shields.io's own, so this badge is the same colour a hosted service would produce for the same percentage. Choosing different thresholds would mean two badges in one README disagreeing about whether 72% is yellow or orange, which is worse than either being wrong.
The limitation is inherent and worth stating plainly: the number is baked into the URL, so the badge shows the coverage of the report pasted here and does not change when the code does. On a release tag that is accurate. On a default branch it will quietly claim a figure from whenever it was generated, so regenerate it in CI or use a service that reads the report on each run.
No. The percentage is part of the URL, so it shows the coverage of the report you pasted and stays at that number until you regenerate it. That is fine for a release tag and misleading on a default branch — regenerate it in CI, or use a service that reads the report on each run.
They are the thresholds shields.io itself applies to coverage badges, so this badge is the same colour a hosted service would produce for the same number. Two badges in one README disagreeing about a colour is worse than either being wrong.
Yes, and it is often the more honest figure. Branch coverage is the metric that falls when a condition is added without testing its other side, so it tends to track the quality of a test suite more closely than line coverage does.
Because the report does not carry it — most commonly statements in an LCOV file, which has no statement records. Pick lines, functions or branches, or use an Istanbul report, which reports all four.
No. The badge URL is assembled in your browser. The badge image itself is served by shields.io when someone views your README, which is a request from their browser rather than from here.
If a tool here saved you some time, you can put something towards the hosting.Buy me a coffee, on Ko-fi, opens in a new tab