CSS components

CSS Activity Heatmap Generator

Turn daily counts into the familiar calendar heatmap made of small squares. Paste dates and values or use sample data, pick a colour scale and copy a static HTML and CSS component.

Leave the box empty to use random sample data. Repeated dates are added together.

Live preview

Runs entirely in your browser. Nothing is uploaded to any server.

Why use this heatmap generator

No chart library

Static HTML and CSS that loads instantly and never breaks.

Your own data

Paste dated counts from a spreadsheet or app export.

Any habit

Commits, workouts, words written or pages read.

How to build an activity heatmap

  1. Add your dataPaste lines like 2026-03-14, 4 or leave the box empty for sample data.
  2. Set the calendarChoose the number of weeks, the last day and the week start.
  3. Style and copyPick colours, sizes and labels, then copy the HTML and CSS.

How the heatmap grid is laid out

The grid uses CSS Grid with seven rows and grid-auto-flow: column, so each week fills one column from top to bottom, exactly like GitHub's contribution graph. Days after your last day are kept as invisible cells so the last column lines up.

Each day gets one of five levels. Level 0 means no activity, and levels 1 to 4 split the range between 1 and your highest daily value into quarters. Custom colours are blended from the empty colour to your chosen colour so the scale always looks even.

Tooltips

Every square has a title showing the date and the count.

Accessible summary

The grid has role="img" with a label that gives the total.

Scrolls on phones

Wide graphs scroll sideways instead of overflowing the page.

Activity heatmap FAQ

What data format does it accept?

One line per day with an ISO date and a number, such as 2026-03-14, 4. Commas, semicolons, tabs or spaces can separate them.

How are the colour levels calculated?

Zero is the empty colour. Other values are split into four equal steps between 1 and your highest value in the shown range.

Does the output need JavaScript?

No. The heatmap is plain HTML and CSS, so it works in emails that support CSS grid, static sites and documentation.

Can I show only the last few months?

Yes. Set weeks to a smaller number such as 13 for about three months.

Why does the first month label sometimes not appear?

Labels are placed at the week where a month starts and skipped when they would overlap the previous label, just like GitHub.

Try other CSS component tools

More free tools from My Panda Toolbox.