Payroll Calculator Formula

Understand the math behind the payroll calculator. Each variable explained with a worked example.

Formulas Used

Annual Gross Pay

annual_pay = hourly_rate * hours_per_week * 52

Monthly Gross Pay

monthly_pay = hourly_rate * hours_per_week * 52 / 12

Biweekly Gross Pay

biweekly_pay = hourly_rate * hours_per_week * 2

Weekly Gross Pay

weekly_pay = hourly_rate * hours_per_week

Variables

VariableDescriptionDefault
hourly_rateHourly Rate(USD)30
hours_per_weekHours Per Week(hours)40

How It Works

How to Calculate Payroll

Formulas

  • Annual = Hourly Rate x Hours Per Week x 52
  • Monthly = Annual / 12
  • Biweekly = Hourly Rate x Hours Per Week x 2
  • Weekly = Hourly Rate x Hours Per Week
  • These are gross pay amounts before taxes and deductions. Actual take-home pay will be lower.

    Worked Example

    An employee earning $30/hour working 40 hours per week.

    hourly_rate = 30hours_per_week = 40
    1. 01Weekly pay = $30 x 40 = $1,200
    2. 02Biweekly pay = $1,200 x 2 = $2,400
    3. 03Annual pay = $30 x 40 x 52 = $62,400
    4. 04Monthly pay = $62,400 / 12 = $5,200

    Frequently Asked Questions

    How many pay periods are in a year?

    Weekly: 52 pay periods. Biweekly: 26 pay periods. Semi-monthly: 24 pay periods. Monthly: 12 pay periods. Biweekly is the most common in the US.

    Is this calculator for gross or net pay?

    This calculates gross pay (before deductions). Net pay (take-home) depends on federal and state taxes, Social Security, Medicare, health insurance, retirement, and other deductions.

    Learn More

    Guide

    How to Calculate Employee Cost

    Learn how to calculate the true cost of an employee beyond salary. Covers taxes, benefits, overhead, and hidden costs that affect total compensation and business budgeting.

    Ready to run the numbers?

    Open Payroll Calculator