Safety Emporium - Lab and Safety Supplies

JavaScript Payroll Calculator

About this page

This simple JavaScript-based calculator is designed for folks who want to do payroll themselves without having to fork over a fortune to a payroll services company. It works well for employers with a small number of employees and can be used by itself or with an AppleScript that we have written to enter the results into your QuickBooks Mac 2009 file automatically.

Ideally, you will download this page and save a copy to your hard drive (use the Save As Source or other equivalent menu command from your web browser). That will enable you to hard code the state and local tax rates by editing the file so you don't have to re-enter them each time. But if you want to use it directly on our web site, you can.

To use this calculator, double check that you are using the correct tax rates in the Tax Rates Table and then simply fill in the four pieces of data in the Input Payroll Data Here table and click Calculate. Then run the AppleScript we referenced to create a new Paycheck in Quickbooks populated with the output data!

Employee Payroll Calculation

As discussed above, you should edit your local copy of this file. Using a plain text or HTML editor, change the employee list to match those employee names used in your copy of QuickBooks. You can also change the default values for each employee at the beginning of the JavaScript section.

Enter your inputs on the left, and the stuff you need to write checks or import into QuickBooks 2009 Mac will magically appear on the right! You should use the Federal and State withholding values from the employee's individual W-4's.

Input Payroll Data Here
Employee Name
YTD Gross pay (before this check) $
Gross for this pay period $
Federal Withholding this period $
State Withholding this period $

Tip: You can hard-code default amounts for each employee. Check out the HTML code for details.

Output values will appear here
EmployeeCompany
Social Security Witholding (calculate) (calculate)
Medicare Withholding (calculate) (calculate)
Federal Unemployment (calculate)
State Unemployment Withholding (calculate) (calculate)
Federal Withholding (calculate)
State Withholding (calculate)
Local 1 Withholding (calculate) (calculate)
Local 2 Withholding (calculate) (calculate)
Totals (calculate) (calculate)
The Total under Employee is their net paycheck

Once you hit Calculate, leave this window open, run the AppleScript we provided, and your payroll data (14 lines in all!) will automatically be entered as a new check in QuickBooks. Boom, done, as Steve Jobs would say.

Tax rates

To change the default rates and example employee names that appear here, simply edit this HTML file in a text or HTML editor (the default employee gross pay and withholdings are found at the beginning of the JavaScript section). Once you have done that and put in the rates for your state, you should not need to enter anything in this section again unless the rates/thresholds change.

Federal withholding rates and thresholds are available in IRS Publication 15. For tax years 2010 and earlier and for 2013, the employer and employee contributions for Social Security are both 6.2%. In 2011-2012, the employee contribution/withholding rate for Social Security was reduced to 4.2% instead of 6.2% to promote economic stimulus.

PLEASE NOTE - For 2013, there is an additional 0.9% Medicare withholding from employee wages that exceed $200,000. This calculator does not yet account for that.

Tax TypeEmployee shareCompany share
Social Security%%
Social Security Max Base $
Medicare%%
All income is subject to Medicare
Local tax 1%%
Local tax 2%%
Local Tax 1 Max Base $
Local Tax 2 Max Base $
Unemployment Tax
Federal ThresholdFirst $ of income
Federal 940 Multiplier
State ThresholdFirst $ of income
State Company Share%
State Employee Share%

We have provided two local taxes here. You might have city and school tax, or perhaps city and county tax. Most such taxes apply to all income so we've set the default Max Base for each to $999,999. We have not provided Federal or State withholding here - this section handles tax rates, not withholding.

I Want....

We're sure some of you have other needs such as multiple states/jurisdictions etc that are not covered here. This page and the AppleScript that is used with it are meant to be guides or frameworks so that you can add those features yourself. We have heavily commented the code so you can use it as a learning resource. We do not have the manpower to code individual solutions for folks, but are happy to have your feedback.

Table of Contents


Safety Emporium - Lab and Safety Supplies

Notice: Copyright 2010-2024 by Interactive Learning Paradigms Incorporated. All rights reserved. Reposting or redistributing this material or derivatives thereof is not permitted and constitutes a violation of US and International copyright law. You are permitted to make and edit copies of this page for your localized personal/corporate off-line use provided that this entire notice remains intact. This product is offered "as is" and ILPI and its employees (who are not tax professionals or lawyers) will not be responsible for any errors, omissions, problems, tax audits, etc. caused by your incompetence use of this resource. This source document is available (only) at http://www.ilpi.com/help/applescriptQB/payrollcalculator.html