How it works
This CSS heartbeat animation imitates a real pulse: two quick beats close together (the lub-dub), then a rest before the next pair. A single scale bounce on repeat, which many "pulse" snippets use, looks mechanical next to it.
The shape is an inline SVG heart filled with Color. The beat keyframe scales it: 1 at 0%, Beat scale at 14%, back to 1 at 28%, Beat scale again at 42%, then 1 from 70% to 100%. That last 30% of stillness is the pause that makes it read as a heartbeat. With the default 1.3s Duration the tempo is about 46 beats per minute; 0.85s gives a resting human pulse of around 70.
Use it for favorite or like counters, health and fitness apps, donation CTAs and Valentine's promos. Parameters: Size, Color, Beat scale, Duration and Easing. Beat scale between 1.15 and 1.3 is noticeable without the heart crowding nearby text; leave a little margin around the icon because scaling does not reserve extra space.
Scaling uses transform, so it is composited even at large sizes. The SVG is aria-hidden; add a text label nearby if the heart carries meaning. A constantly beating icon pulls attention, so in a list of items animate only the one that matters, or play it a few times and stop. For a heart that reacts to a click, see the Like button micro-interaction.
What is the difference between a heartbeat and a pulse animation?
A typical CSS pulse scales an element up and down evenly on every cycle. A heartbeat has two close beats and a long rest, which the keyframe encodes at 14%, 42% and a still stretch from 70% to 100%. The tool offers both: this preset for the double beat, and the Pulse ring loader or Pulse glow button for a steady pulse.
How do I use a different icon with the heartbeat?
Replace the path data in the svg with your own icon and keep the viewBox at 0 0 24 24 or adjust it to match. The animation is applied to the svg element, so any shape gets the same double beat. It also works on a non-SVG element like an emoji span or a badge; just move the animation to it.
How do I change the heart rate?
Duration is the length of one double beat plus the rest. Divide 60 by the duration to get beats per minute: 1.3s is about 46, 1s is 60, 0.75s is 80. Faster than about 0.6s starts to feel anxious, which can be appropriate for a countdown or urgent alert.