Calculator Notes: Counting Flashes in a GIF Loop

This page works like a calculator you run by hand. It helps you estimate whether a reaction GIF flashes more often than the widely used three-per-second limit. It is a rough screening method only. Proper flash analysis uses specialist tools that measure brightness and area, so treat this as a first check, not a guarantee of safety.

What it computes

The W3C's Web Content Accessibility Guidelines say content should not flash more than three times in any one-second period, unless the flashes are below specified size and brightness thresholds. This calculation estimates the number of flashes per second in a loop, so you can spot obvious problems before sending a clip.

The formula

Flashes per second = number of flashes in one loop / loop length in seconds

A flash here means a pair of opposing changes in brightness: bright to dark and back again, or the reverse. If a scene goes dark and returns to bright, that is one flash.

How to use it

  1. Find the loop length. Watch the GIF and time one full loop. Many editors show the duration directly. Alternatively, count the frames and multiply by the frame delay (see our frame-delay notes for that calculation).
  2. Count the flashes. Watch one loop slowly, if your editor allows stepping through frames, and count each bright-dark-bright cycle.
  3. Divide. Flashes in one loop divided by loop length gives flashes per second.
  4. Check short bursts too. The guideline refers to any one-second period. A clip might average one flash per second but cram four into half a second. Look for clusters.

A worked example

Suppose a hypothetical celebration GIF lasts 2 seconds and, stepping through it, you count 8 bright-dark-bright cycles from a strobing disco light.

8 flashes / 2 seconds = 4 flashes per second.

That exceeds three per second, so unless the flashing area is very small or the contrast very low, this clip should not be sent. A calmer celebration, such as falling confetti without strobing, is the better choice.

Now suppose a different clip lasts 3 seconds with 2 flashes from a camera flash. 2 / 3 is about 0.7 flashes per second, and the flashes are spread out. That is under the limit by this rough check.

Limits of this method

When in doubt

If you cannot count the flashes because they are too fast, that alone is a strong sign the clip is unsafe. Skip it. For background on flash thresholds, see the glossary.