Developer 工具已更新 1 天前

Markdown Badge Generator

Build shields.io badge Markdown for your README. Enter a label, message and color, pick one of five styles, add an optional logo and link, and press Generate Badge. The snippet is built in your browser, previewed live from img.shields.io, and ready to copy or download as markdown-badge.md.

永久免费 易于使用 立竿见影的效果 私密且安全

使用 Markdown Badge Generator

Markdown 徽章生成器

生成 shields.io 徽章的 Markdown 代码,支持自定义标签、信息、颜色、样式、徽标以及可选链接。

徽章设置

自定义徽章的内容和外观
左侧文本。
右侧文本。
示例:蓝色、红色、亮绿色
使用 shields.io 徽标,名称如 github、laravel、npm、docker、php 等。
如果提供了徽章,该徽章将变为可点击的 Markdown 代码。
尚未生成
徽章状态
无链接
可点击的徽章

徽章预览

由 shields.io 生成的 URL 的可视化预览
等待
在此生成徽章并预览。

输出 Markdown

复制或下载生成的徽章 Markdown 代码
徽章提示
对于 GitHub 的 README 文件,常见的徽章颜色有蓝色、绿色、亮绿色、橙色和红色。

阅读内容

了解该工具的工作原理以及何时使用它。

What the Markdown Badge Generator does

The Markdown Badge Generator builds the small two-part status labels you see at the top of GitHub README files, such as "build | passing" or "license | MIT". You fill in a few fields, press Generate Badge, and the tool writes a ready-to-paste Markdown image tag that points at a shields.io static badge URL. A live preview shows the badge exactly as shields.io draws it, so you can check the colors and wording before the snippet goes into your repository.

Badges are a tiny detail, but they do real work. A visitor landing on a project page reads them in a second and learns the license, the current version, the language, whether the docs are online, and where to get support. Writing the URL by hand means remembering the shields.io path format, encoding special characters and wrapping everything in the right brackets. This page removes that busywork.

The fields and what each one controls

The Badge Settings card on the left holds six inputs. Every one maps to a specific piece of the generated URL or Markdown.

FieldWhat it setsDefault when left empty
LabelThe left-hand text on the grey half of the badgelabel
MessageThe right-hand text on the colored halfmessage
ColorThe color of the message half, for example blue, red or brightgreenblue
StyleOne of five shields.io looks: flat, flat-square, for-the-badge, plastic, socialflat
Logo optionalA shields.io logo name such as github, laravel, npm, docker or php, added as &logo=No logo
Link optionalA URL that turns the badge into a clickable linkNot clickable

Because empty fields fall back to defaults, pressing Generate Badge with nothing typed still produces a valid "label | message" badge in blue. That is handy as a quick test, but remember to replace the placeholders before you publish.

What the output looks like

Without a link, the output is a single Markdown image:

![build](https://img.shields.io/badge/build-passing-brightgreen?style=flat&logo=github)

With a link, the image is wrapped inside a Markdown link so that clicking the badge opens your page:

[![build](https://img.shields.io/badge/build-passing-brightgreen?style=flat)](https://example.com)

The label text doubles as the image alt text, which is what screen readers announce and what appears if the image fails to load. Pick a label that makes sense on its own for that reason.

How to create a badge, step by step

  1. Type the left-side text into Label, for example license.
  2. Type the right-side text into Message, for example MIT.
  3. Enter a color name or a hex code in Color. Hex codes go in without the hash sign, such as ff69b4.
  4. Choose a look from the Style drop-down.
  5. If you want an icon, type its name into Logo optional.
  6. If the badge should be clickable, paste a full address starting with http:// or https:// into Link optional.
  7. Press Generate Badge. The Badge Preview card shows the rendered badge and the Output Markdown editor fills with the snippet.
  8. Press Copy Badge to put the snippet on your clipboard, or Download to save it as markdown-badge.md.
  9. Paste it at the top of your README, usually right under the project title.

The two status cards above the preview give quick feedback. Badge status switches from "Not generated yet" to "Badge generated", and Clickable badge reads "No link", "Valid link" or "Check link" depending on what is in the Link field. The footer under the output shows the snippet length and the length of the shields.io URL in characters. Clear resets every field, sets Style back to flat and empties the preview.

How it works behind the scenes

All the building happens in your browser with a few lines of JavaScript. Nothing you type is sent to this site's server. The tool URL-encodes each of the three text parts, joins them with hyphens into the path img.shields.io/badge/LABEL-MESSAGE-COLOR, and appends ?style= plus an optional &logo= parameter.

The preview is a normal image request to img.shields.io, the free badge service that GitHub READMEs rely on. That means your browser contacts shields.io to draw the preview, and anyone who later views your README will load the badge from shields.io too. If shields.io is slow or blocked on your network the preview may stay blank even though the Markdown is correct.

Getting spaces, hyphens and underscores right

This is the one area that trips people up. The shields.io badge path uses single hyphens to separate the label, message and color. The tool converts every space you type into a hyphen, so a label like build status becomes build-status in the URL, and shields.io then reads "build" as the label and "status" as the message. The badge comes out wrong.

The fix is to use the shields.io escape conventions yourself in the input fields:

  • Type an underscore where you want a space: build_status renders as "build status".
  • Type a double hyphen where you want a literal hyphen: pre--release renders as "pre-release".
  • Type a double underscore where you want a literal underscore: snake__case renders as "snake_case".

The live preview is the quickest way to confirm the badge reads the way you expect. If the preview shows text shifted between halves, check for a stray space or single hyphen.

Practical uses

  • Open-source projects: license, latest version, supported language version and "PRs welcome" badges in the README header.
  • Internal repositories: a "docs | internal" badge linking to the wiki, or a "owner | platform team" badge so people know who to ask.
  • Course and template repos: labels such as "level | beginner" or "status | archived" that set expectations at a glance.
  • Package pages: badges for npm, Docker or PHP using the matching logo name.
  • Profile READMEs: a row of skill or tool badges with logos, each linking to a project.

Tips for clean, readable badges

  • Keep labels short. One or two words per half reads best at badge size.
  • Use color to mean something. Green for passing or stable, orange for beta or warning, red for failing or deprecated, blue for neutral information.
  • Use the same style for every badge in a row. Mixing flat and for-the-badge looks untidy.
  • The social style is designed for counters and follow buttons; it does not show your custom color the way the other styles do.
  • Check the link status card before copying. "Check link" means the Link field does not start with http or https, and the badge may not click through correctly.
  • When you need several badges, generate them one after another and paste each snippet on the same line in your README separated by a space so they sit side by side.

What not to do

  • Do not expect a live, auto-updating badge. This tool builds static badges whose text is fixed. A "build | passing" badge made here will say "passing" forever, even if your build breaks. Dynamic badges that read from CI, npm or GitHub need a different shields.io endpoint.
  • Do not put secrets, private URLs or internal hostnames in the label or message. The text becomes part of a public image URL that shields.io receives.
  • Do not type a # in front of a hex color. It gets encoded and shields.io will not recognise it.
  • Do not rely on an unknown logo name. If shields.io does not know the name, the badge simply appears without an icon.

Limitations

  • Only static badges in the /badge/ format are produced. There are no options for dynamic data, query-based endpoints or JSON sources.
  • The available parameters are style and logo. Options such as logo color, label color, cache seconds or custom width are not exposed in the form, though you can add them to the URL by hand after copying.
  • Spaces are converted to hyphens, so you must use underscores for spaces as described above.
  • The Link field is checked only for an http or https prefix. The tool does not visit the address to see whether it works.
  • The preview depends on img.shields.io being reachable from your browser.
  • The output is Markdown only. If your site needs an HTML <img> tag or reStructuredText, you will need to convert it.

Related Markdown tools

Once your README has its badges, the Markdown Link Extractor lists every link in the file and the Markdown Image Extractor lists every image, including your badge URLs, which makes a quick audit easy.

Frequently Asked Questions

常见问题解答

针对用户在信任结果之前常提出的疑问,提供简短解答。

The tool builds URLs for img.shields.io static badges. Your browser loads the preview from shields.io, and readers of your README load the badge from the same place.

Spaces are turned into hyphens, and shields.io treats a single hyphen as a separator. Type an underscore instead of a space, for example build_status, and the badge will show "build status".

Yes. Type the hex value without the hash sign, for example ff69b4 or 007ec6, into the Color field and check the preview.

Paste a full http or https address into Link optional before pressing Generate Badge. The output then wraps the image in a Markdown link, and the Clickable badge card reads Valid link.

No. These are static badges, so the label and message stay exactly as you typed them. Regenerate and replace the snippet when the information changes.

No. The Markdown is assembled in your browser. The only network request is the preview image, which your browser fetches from img.shields.io.

A small Markdown file named markdown-badge.md containing the generated snippet, ready to copy into a README.

The logo name must match one shields.io recognises, such as github, npm, docker, laravel or php. An unknown name is ignored and the badge renders without an icon.

评论 (0)

用于用户讨论、边界情况及后续建议。
发表评论
您的评论提交后将公开展示。
目前尚无评论。快来发表第一条评论吧!
请告诉我们!
报告此工具的问题

请描述您遇到的问题,以便我们进行调查并改进该工具。

什么最有帮助
请提供输入内容、预期结果、实际结果、浏览器/设备信息,如有帮助,请附上截图。
“截图”按钮会截取浏览器中的页面,并将生成的图片作为附件添加到此表单中。
整页截图
通过 newisty 在您的浏览器中捕获。
尚未截取屏幕截图。
工具 报告