Badges at the top of a README communicate project health at a glance — build passing, MIT licensed, version 2.1.0. This generator builds the shields.io static-badge URL for you and wraps it in ready-to-paste Markdown or HTML, handling the tricky character escaping that trips people up.
How it works
Shields.io exposes a static badge at a predictable URL:
https://img.shields.io/badge/<label>-<message>-<color>
The single dash between the three parts is a separator, so the label and message
themselves have to escape any literal dashes by doubling them (- becomes --)
and represent spaces with underscores (_). Color can be a named value such as
brightgreen or a hex code like 4c1. An optional ?style= query selects the
visual style. The Markdown wrapper is ; the HTML wrapper is an
<img> tag.
Common badges and what they communicate
The most useful static badges for open source and internal projects:
| Label | Message example | Color | Communicates |
|---|---|---|---|
build | passing / failing | brightgreen / red | CI health |
license | MIT / Apache 2.0 | blue | Usage rights at a glance |
version | v2.1.0 | informational | Current release |
coverage | 87% | yellow | Test coverage level |
status | active / maintained | green | Project maintenance state |
platform | node 20+ | lightgrey | Runtime requirements |
Escaping rules that trip people up
Shields.io uses a dash as the separator between label, message, and color — which means literal dashes in your text must be doubled. This generator handles that automatically, but it is useful to know why:
- A message of
v2.1.0-betamust becomev2.1.0--betain the URL - A space becomes
_(underscore), sobuild passingbecomesbuild_passing - Percent signs must be URL-encoded as
%25, otherwise the browser strips the%and the following two characters
Style options
The ?style= parameter changes the visual appearance. Common choices:
flat— the default; small, minimalflat-square— same but squared cornersfor-the-badge— larger, uppercase, bolder — popular for prominent status rowssocial— mimics social-media button style
Example and tips
A badge labeled build with message passing in brightgreen produces
https://img.shields.io/badge/build-passing-brightgreen. If your message is
v2.1.0 stable, the space becomes an underscore and the URL becomes
https://img.shields.io/badge/version-v2.1.0_stable-blue.
Keep badges to three or four — coverage, build, license, and version are the most useful — and place them on a single line directly under the project title. Too many badges signal noise rather than quality, and they add visual clutter that buries the actual project description.