Animation Frame-Rate & Flash Risk Estimator

Paste a CSS keyframe animation and estimate flash frequency for seizure safety

Ad placeholder (leaderboard)

Fast flashing content can trigger seizures in people with photosensitive epilepsy, which is why WCAG 2.3.1 caps it at three flashes per second. The trouble is that a blink animation does not advertise its frequency. This tool reads your CSS, estimates the flash rate in hertz, and tells you whether it is within the safe limit.

How it works

The tool extracts the iteration duration from an animation-duration property or from the time value in an animation shorthand, giving cycles per second as 1 / duration.

It then parses the @keyframes block and reads the opacity, visibility and display at each stop. After sorting the stops by position, it counts the dark troughs, that is the points where brightness dips below its neighbours on both sides. Each trough corresponds to one full flash within a cycle. The estimate is:

cyclesPerSecond  = 1 / duration
flashesPerSecond = pulsesPerCycle * cyclesPerSecond

A classic blink that goes opacity 1 then 0 then 1 has one dark trough per cycle, so a 0.2s duration produces about five flashes per second, which fails the 3 Hz limit.

Worked example

A rule of animation: blink 0.2s infinite with one trough per cycle gives 1 / 0.2 = 5 cycles per second and therefore roughly 5 Hz. That is above 3 Hz and would be flagged as a fail. Slowing it to 0.4s or longer brings it under the threshold, and removing the flash entirely is safer still.

Tips and notes

  • Treat 3 Hz as a hard ceiling, not a target. Comfortable, accessible motion is slow and smooth.
  • Always wrap flashing or fast motion in a prefers-reduced-motion: reduce media query so users who request less motion get a calm experience.
  • The estimate covers opacity and visibility reversals. For colour-only or background flashes, verify the actual rendered luminance contrast separately, since the risk depends on the specific colours.
  • All analysis is static and local to your browser. The animation is never rendered and nothing you paste is sent anywhere.
Ad placeholder (rectangle)