Developer and Text Tools

README Badges Explained: What to Show, How They Work and Why Local SVGs Help

Which badges are worth putting in a README, how shields-style badges are built, colours and styles, and when to commit SVG files instead of hotlinking.

Saizul Amin
Saizul Amin5 Nov 2026 · 4 min read
README Badges Explained: What to Show, How They Work and Why Local SVGs Help

The row of small coloured labels at the top of a README has become a convention of open source. Build passing, version 2.3.1, license MIT, coverage 87%. In two seconds a visitor knows whether the project is alive, which release to use and whether they can legally use it. Like any convention, badges can be done well or turned into clutter.

Which badges earn their place

A useful badge answers a question a visitor actually has. The usual short list is: build or CI status, the latest version on the package registry, the licence, test coverage and the supported runtime such as the Node or Python version. Documentation and chat links are useful as badges too, because they are easy to spot. Badges for stars, followers or "made with love" add little. Five or six badges is plenty; a wall of twenty hides the important ones.

How a badge is built

A shields-style badge is a small SVG with two halves. The left half, usually grey, holds the label; the right half, coloured, holds the message. Each half is as wide as its text plus a few pixels of padding, so the generator has to know how wide the text will be. Badge services measure it with the font metrics of Verdana at 11 pixels and write a textLength attribute so the text fits exactly, even on systems that substitute another font.

Colours carry meaning by convention: bright green for passing and healthy, yellow and orange for warnings, red for failing, blue for neutral information such as versions and licences. Coverage badges usually follow a scale, bright green from 95 percent, green from 90, yellow-green from 75, yellow from 60, orange from 40 and red below that.

There are a few styles. Flat, with slightly rounded corners and a soft gradient, is the common default. Flat square drops the rounding and gradient. Plastic is shorter and glossier. For-the-badge is taller with bold capital letters and suits a hero row in a project landing page.

Hotlinked or committed?

Most READMEs link badges from a hosted service. That is the right choice for values that change on every commit, like CI status pulled live from your pipeline. But a hosted badge has costs. Every view of your README triggers a request to the service, which may be slow or rate-limited. Some corporate networks block it, and if the service changes URLs the badge breaks.

For values that only change at release time, such as licence, version, minimum runtime or a "docs" link, a committed SVG file is simpler. It lives in your repository, loads with the page and never breaks. You update it when you cut a release, or have CI regenerate it.

Making a set of badges

The README Badge Generator draws badges in your browser and gives you the SVG files. Start from presets such as build passing, version, licence, coverage or PRs welcome, or add a blank badge. Edit the label and message, choose colours by hex value or by the familiar names, pick a style and add a link so the badge opens your CI runs or LICENSE file. You can embed a small logo from your own SVG or PNG file too.

The snippet box writes Markdown, HTML or reStructuredText for the whole row, pointing at the folder where you will commit the files. If you prefer hosted badges for some of them, a switch writes the equivalent shields.io URLs instead. Download the ZIP, commit the SVGs and paste the snippet.

Accessibility counts

Badges are images, so screen reader users only get what the alt text says. "build: passing" is useful; "badge" or an empty alt is not. The generated SVGs carry a title and an aria-label with the same words, and the Markdown alt text defaults to them as well.

Keep them honest

A badge is a claim. A "build passing" badge that is just a static file is misleading if the build is red. Use static files for facts that are true until you change them, and dynamic badges, or a CI job that regenerates the SVG, for anything that can break between releases.

Summary

Pick a few badges that answer real questions, use colours the way readers expect, and decide per badge whether it should be live or static. Static SVGs committed to the repository are fast, private and reliable for release-time facts; generate them, give them alt text and keep the row short.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages