FLOPs Calculator

Estimate forward FLOPs and MACs for Linear and Conv2d operations, including batch size, spatial dimensions, groups, stride and dilation.

Built by Michael Lip

Frequently Asked Questions

What are FLOPs?

FLOPs count floating point operations. This tool uses one MAC = two FLOPs. Linear(512, 256) with one input vector has 131,072 MACs and 262,144 core FLOPs, excluding bias.

FLOPs vs FLOPS?

FLOPs is an operation count; FLOPS is a rate per second. Operation counts alone do not predict latency: memory traffic, hardware utilization and kernels also matter.

How to calculate Conv2d FLOPs?

Core FLOPs = 2 × batch × output channels × output height × output width × (input channels / groups) × kernel height × kernel width. Conv2d(3, 64, 3, padding=1) on [1, 3, 224, 224] has 173,408,256 core FLOPs. Without padding the output is 222×222 and the count changes.

FLOPs vs parameters?

Parameters describe stored model weights. FLOPs describe estimated arithmetic for an input. Reusing convolution weights across spatial positions means parameter counts alone cannot determine FLOPs.

What is included?

One dense Linear or Conv2d forward operation, with optional separate bias additions. LSTM, attention, activations, normalization, backward passes and whole-model profiling are not included. The result is a mathematical estimate, not a hardware measurement.

Is this tool free?

Yes. This calculator runs in your browser and requires no signup.

About This Tool

Part of HeyTensor. All calculations run in your browser. Source code on GitHub.

Formula references: PyTorch Conv2d, Linear, and profiler FLOPs scope.

Contact

Built by Michael Lip. Email [email protected].

TENSOR PREFLIGHT · DOWNLOADABLE PYTORCH TOOLKIT

Take the next step in your own PyTorch model.

Trace a local forward pass, inspect tensor shapes in an HTML report, and turn a repair into a regression check. Includes eight broken-and-fixed workflows, source code and setup instructions.

Python 3.9+ · PyTorch 2.8+ · Runs locally

Get Tensor Preflight — $29 One-time payment · ZIP download See a sample report
Based on real data from our PyTorch Error Stats
By the same builder: GitHub, theluckystrike BeLikeNative, Grammar AI EarlyThunder, Dev Blog Bug Bounty Reality Zovo, AI Dev Tools