SVG badge generator — shields-style badges for README files

Type a label and a message, pick two colours and a style, and the tool draws a shields-style badge as a standalone SVG, with Markdown for both the local file and the matching shields.io link.

Live demo · real result from this tool
Style

SVG

SVG

Markdown

![build](badge.svg) <!-- or the equivalent hosted shields.io badge: -->![build](https://img.shields.io/badge/build-passing-44cc11?style=flat) 

Text widths are estimated for Verdana 11px, so a very long or non-Latin label may be slightly too wide or narrow.

Processed on your device — nothing is uploaded.

How to use the SVG badge generator

  1. Type the Label (the grey left part, such as “build” or “license”). Leave it blank for a one-part badge.
  2. Type the Message (the coloured right part, such as “passing” or “MIT”). It cannot be empty.
  3. Pick a Label colour and a Message colour.
  4. Choose a Style: Flat (rounded corners with a soft shine), Flat square (square corners, no shine) or For the badge (taller, bold capitals).
  5. Download badge.svg and copy the Markdown into your README.

What it does and when to use it

Badges are the small two-colour labels at the top of many open-source README files. They show facts at a glance: the licence, the current version, the supported language, or a “docs” link. This tool makes the same look without an account or a network call, so you can create badges for private projects, slide decks or internal wikis too.

For a whole README, the README generator can sit around your badges. For round status icons rather than text labels, try the SVG checkmark generator. For a project avatar to go beside the badges, use the SVG identicon avatar generator.

How it works

The tool estimates the width of each text part from character classes: narrow letters such as i and l, wide ones such as m and W, capitals, digits and others. It adds padding on both sides and draws two rectangles side by side. Flat style adds a 3 px corner radius and a faint top-to-bottom shine. For the badge uses 10 px bold capitals with extra letter spacing and a height of 28 px instead of 20 px.

Each text is drawn twice: a 30% dark copy one pixel lower acts as a shadow, and the white text sits on top. The SVG carries an aria-label and a title, such as “build: passing”, for screen readers. Text is escaped, so characters like < and & are safe. The shields.io link is built by the same rules shields.io uses for its static badge URLs: dashes and underscores are doubled, and other characters are URL-encoded.

Worked examples

Default build badge. Label “build”, message “passing”, flat. The SVG is 94 × 20, and the Markdown includes ![build](https://img.shields.io/badge/build-passing-44cc11?style=flat).

Licence badge. Label “license”, message “MIT”, colour #007ec6, flat square. The tag reads width="85" height="20" viewBox="0 0 85 20" role="img" aria-label="license: MIT".

Version, one part. Empty label, message “v2.4.0”, for the badge. The text becomes >V2.4.0</text> in capitals on a 63 × 28 badge.

Empty message. A message of only spaces returns “Enter a message for the badge.” instead of an SVG.

Limits and tips

  • Keep messages short; badges are meant to be read in a glance.
  • Pick a message colour with enough contrast for white text. Bright yellows and light greens can be hard to read.
  • Line up several badges by putting their Markdown on one line, separated by spaces.

Frequently asked questions

Should I use the downloaded SVG or the shields.io link?
Commit the SVG to your repository if you want a badge that never changes and does not depend on another website. Use the shields.io link if you would rather not store a file; the image is then fetched from shields.io whenever someone views your README. This tool does not contact shields.io itself.
Can the badge update itself, for example with the latest version number?
No. The text is fixed when you make it. Live badges that read a build status or a package version come from services such as shields.io with a dynamic URL; this tool makes static badges.
Why does the text look slightly off-centre with some words?
The tool estimates text width from a table of typical Verdana 11px character widths instead of measuring the real font. Long labels, emoji and non-Latin scripts can come out a little too wide or too narrow.
How do I make a badge with only one part?
Clear the Label field. The badge then shows only the message on the message colour.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close