Microwave surface resistance of type-II superconductors is investigated via the finite-element method by calculating the electromagnetic field distribution within a superconductor. The software allows changing the geometrical parameters in a facile way. Using a finite-element procedure and the approximation by Bonura et al. [Eur. Phys. J. B 52 (4), 459 (2006); Eur. Phys. J. B 53 (3), 315 (2006)], it is shown that the microwave surface resistance of type-II superconductors can be numerically calculated in the framework of the critical-state model.