How to add a visitor counter to a GitHub README

A GitHub README can show images but never runs scripts, so the only kind of counter that works there is an image that updates itself. Here is how to add one and how to read it honestly.

Create the counter

Open the free hit counter page, pick a label and a style and press Create my counter. Copy the Markdown line it gives you.

Add it to the README

Paste the Markdown line into README.md where you want the counter to appear, commit and push. For a profile README, the file lives in the repository named after your username.

How GitHub shows it

GitHub fetches every README image through its own image proxy. The counter sends no-cache headers so the proxy asks for a fresh copy, but GitHub can still hold an image for a few minutes, so the number may lag.

What the number means

It counts how many times the image was loaded, at most once every 30 minutes for the same visitor, with known bots left out. Because GitHub's proxy fetches the image, many viewers can share one fetch, so treat it as a rough popularity signal, not exact visitor numbers.

Want more than a number?

For a project website or documentation site on GitHub Pages, you can add the full BYOViral script to the site and see pages, sources and countries. GitHub Pages serves your own HTML, so scripts work there.

Frequently asked questions

Can I add the BYOViral tracking script to a README?

No. GitHub strips scripts from Markdown. Only images work in a README.

Will the counter reset?

No. The number is stored on our side and keeps going. Keep the counter link; without an account it cannot be recovered.

Can I start from an existing number?

Yes. Set the starting number when you create the counter.

Try BYOViral free

Privacy-first analytics with no cookies and a real free tier.

Create your free account →