Withholding32 User Manual


Latest Version: December 31, 2021

Table of Contents

  • About Withholding32
    Withholding 32 allows calculation of Federal, State and Local Payroll Withholding. It also calculates family leave, SUI, SDI, FICA and Medicare Payroll Withholding. Various specialized state taxes are also supported. It is provided as both a 32bit and 64bit Windows DLL and as a Linux Shared Object file.

    Functions are provided to return local tax body names and id's to facilitate creating prompts for users to select from.
    Hint: On the Withholding32 webpage go to the tab Samples for actual code!
    The code snippets used throughout this manual are not complete executable programs, but are used only to illustrate particular items. The Withholding32 website has complete packages which can be downloaded.
  • Using Withholding32 Many structures are mentioned in this manual. Refer to the wh32.h supplied file for complete descriptions of all structures and #defines.
    • Visual Basic
      In Visual Basic you have to declare each of the Withholding32 functions. Here is an example
      Declare Function WH32_Calc Lib "wh32.dll" (ByVal command As Long, ByRef wh As FEDERAL_WITHHOLDING_STRUC, ByRef stwh As STATE_WITHHOLDING_STRUC) As Long

      command will be (from wh32.h)
      WH32_COMMAND_FEDERAL_ONLY
      WH32_COMMAND_FEDERAL_AND_STATE
      WH32_COMMAND_FEDERAL_EMPLOYER_FICA_MEDICARE
      WH32_COMMAND_GROSSUP_REGULAR
      WH32_COMMAND_GROSSUP_SUPPLEMENTAL
      There are a number of other functions you will use. These will be detailed in this manual. Notice the library name "wh32.dll". For this declaration to work the 32bit Withholding32 Library would have to be placed in the same folder as your apps executable.

      You will also have to setup various structures used by the Withholding32 program. Here is an example for a 64 bit build
      Structure MDATE
      month As Long
      day As Long
      year As Long
      End Type


      Here is an example for a 32 bit build. Notice that all Long variables have been replaced by Integer.
      Structure MDATE
      month As Integer
      day As Integer
      year As Integer
      End Type
    • Visual C++ Dynamic Loading
      With Dynamic Loading you explicitly load the dll at runtime using the LoadLibrary function. Here is an example of what you would do.
      INSTANCE hGetProcIDDLL =LoadLibrary(TEXT("wh32.dll"));
      DWORD dw=GetLastError();

      FARPROC lpfnGetProcessID3 = GetProcAddress(HMODULE (hGetProcIDDLL),"WH32_Get_Prompt");
      typedef long(__stdcall * pICFUNC3)(WITHHOLDING_TAXBODY_INFO *wt,char * c);
      pICFUNC3 WH32_Get_Prompt;
      WH32_Get_Prompt=pICFUNC3(lpfnGetProcessID3);
      dw=GetLastError();
    • Visual C++ StaticLoading
      With Static Loading you link your program with the .lib file we provide and then the DLL functions will be loaded automatically at run time. With this method you must modify your build procedure with these two steps.
      1)  In your Projects "Properties/Linker/General/Additional Library Directores" add an entry to point to the location of wh32.lib
      2)  In your Projects "Properties/Linker/Input/Additional Dependencies" add the name wh32.lib
      You can then call the DLL functions without the LoadLibrary function call.
    • Visual C#
      (Thanks to John M for this C# info
      Created an app in Visual Studio:

      using System; using System.Runtime.InteropServices;

      namespace PlaygroundNET
      {
      class Program
      {
      static void Main(string[] args)
      {
      GetWH32Version();
      Console.ReadKey();
      }
      [DllImport("wh32.dll")] private static extern double WH32_Table_Version();
      public static void GetWH32Version()
      {
      double Version = WH32_Table_Version();
      Console.WriteLine("Tax Table version is {0}", Version.ToString());
      }
      }
      }

      I have the DLL as an embedded resource with the Copy To Output Directory set to Copy Always.
      You can then call the DLL functions without the LoadLibrary function call.
  • Data Structures
    We supply a header file (wh32.h) which provides all data structures required for using C++ to call our functions. Always go to the wh32.h included with the distribution package for the required structures.

    However, if you are using Visual Basic you will have to convert the wh32.h structures to the corresponding Visual Basic structures.  Our earlier discussion of Visual Basic shows examples for 32 and 64 bit builds.




    Other structures referenced in this manual can be found in the included file wh32.h

    Note that some structure have an element 'struct_size'. It is required that you fill this in before calling any function which used the structure. The length you put in tells the function which version of the structure you are using.

    In Visual Basic you might do this: wh.struct_size = Len(wh)

    In C++ you might do this: fedwh.struct_size=sizeof(FEDERAL_WITHHOLDING_STRUC);
  • Public Functions
    What follows is a list of prototypes for all public functions in the Withholding32 DLL. The Prototype shown is for "C++".
    • WH32_Version
      Returns the DLL software version.

      C Prototype
      extern "C" double WINAPI WH32_Version(void);
      Visual Basic declaration
      Declare Function WH32_Version Lib "wh32.dll" () As Double
    • WH32_Table_Version
      Returns the tax table version. This will change with every new release.

      C Prototype
      extern "C" double WINAPI WH32_Table_Version(void);
      Visual Basic declaration
      Declare Function WH32_Table_Version Lib "wh32.dll" () As Double
    • WH32_Calc
      Calculates Federal and State withholding.

      C Prototype
      extern "C" long WINAPI WH32_Calc(long command,struct FEDERAL_WITHHOLDING_STRUC *wh,struct STATE_WITHHOLDING_STRUC *stwh);
      Visual Basic declaration
      Declare Function WH32_Calc Lib "libwh32.dll" (ByVal command As Long, ByRef wh As FEDERAL_WITHHOLDING_STRUC, ByRef stwh As STATE_WITHHOLDING_STRUC) As Long

      Command for this and other CALC functions will be (from wh32.h)
      WH32_COMMAND_FEDERAL_ONLY
      WH32_COMMAND_FEDERAL_AND_STATE
      WH32_COMMAND_FEDERAL_EMPLOYER_FICA_MEDICARE
      WH32_COMMAND_GROSSUP_REGULAR
      WH32_COMMAND_GROSSUP_SUPPLEMENTAL

    • WH32_Calc_Local
      Calculates Federal, State, and Local withholding.

      C Prototype
      extern "C" long WINAPI WH32_Calc_Local(long command,struct FEDERAL_WITHHOLDING_STRUC *wh,struct STATE_WITHHOLDING_STRUC *stwh,struct LOCAL_WITHHOLDING_STRUC *localwh);
      Visual Basic declaration
      Declare Function WH32_Calc_Local Lib "libwh32.dll" (ByVal command As Long, ByRef wh As FEDERAL_WITHHOLDING_STRUC, ByRef stwh As STATE_WITHHOLDING_STRUC, ByRef ctwh As LOCAL_WITHHOLDING_STRUC) As Long
    • SDI_Calc
      Returns State disability insurance deduction

      C Prototype
      extern "C" long WINAPI SDI_CAlc(struct SDI_WITHHOLDING_STRUC *sdi);
    • FUTA_Calc
      Returns Federal unemployment insurance deduction

      C Prototype
      extern "C" long WINAPI FUTA_CAlc(struct FUTA_WITHHOLDING_STRUC *futa);
    • SUI_Calc
      Returns State unemployment insurance deduction

      C Prototype
      extern "C" long WINAPI SUI_CAlc(struct ETT_WITHHOLDING_STRUC *sui);
    • ETT_Calc
      Returns California ETT

      C Prototype
      extern "C" long WINAPI ETT_CAlc(struct ETT_WITHHOLDING_STRUC *ett);
    • TT_Calc
      Returns Oregon Transportaton Taxes

      C Prototype
      extern "C" long WINAPI TT_CAlc(struct TT_WITHHOLDING_STRUC *tt);
    • FAMLEAVE_Calc
      Returns Family Leave Tax

      C Prototype
      extern "C" long WINAPI FAMLEAVE_CAlc(struct FAMLEAVE_WITHHOLDING_STRUC *famleave);
    • WH32_Get_Prompt
      Returns information (e.g. names) of local taxing bodies. The structure WITHHOLDING_TAXBODY_INFO is defined in wh32.h

      C Prototype
      extern "C" long WINAPI WH32_Get_Prompt(struct WITHHOLDING_TAXBODY_INFO *wt,char * buffer);
      Visual Basic declaration
      Declare Function WH32_Get_Prompt Lib "libwh32.dll" (ByRef id As WITHHOLDING_TAXBODY_ID, ByVal ss As String) As Long
      Structure WITHHOLDING_TAXBODY_ID
      Dim struct_size As Integer
      Dim errorx As Integer
      Dim state As Integer
      Dim muni_type As Integer
      Dim prompt_number As Integer
      Dim desired_entry As Integer
      Dim number_of_entries As Integer
      Dim muni_number As Integer
      Dim calc_number As Integer
      End Structure
    • WH32_Canada_Calc
      Calculates Canada Federal and Provincial withholding as-well-as ccp and ei withholding amounts. (Currently does not work for Quebec)

      C Prototype
      extern "C" long WH32_Canada_Calc(long command,struct CANADA_FEDERAL_WITHHOLDING_STRUC *wh, CANADA_PROVINCIAL_WITHHOLDING_STRUC *whp);
    • WH32_Canada_Get_CC
      Returns Canada claim code amounts for Federal and Provincial
      C Prototype
      extern "C" long WH32_Canada_Get_CC(long command,struct CANADA_CLAIM_CODE_STRUC *ccs);
  • Federal Withholding Calculations
    All elements of the structure FEDERAL_WITHHOLDING_STRUC must be initialized to 0's or a valid value by the application before calling any of the calculation functions. Here are specific instructions for initializing the FEDERAL_WITHHOLDING_STRUC. Items not listed here are returned by the calculation function – but should be initialized to 0 by application.
    Returned by function
    ElementSourceDescription
    struct_size Your Application
    dummy Not Used
    federal_error function returns this
    federal_exemptions W4 Any integer value
    federal_table_date Your Application This date is used to pick table for all tax (state and local too) calculations
    federal_table W4 From wh32.h one of
    FEDERAL_STATUS_SINGLE
    FEDERAL_STATUS_MARRIED
    FEDERAL_STATUS_MARRIED_WITHHOLD_AS_SINGLE
    federal_period W4 Any Long Integer Value
    federal_taxable_pay Your application Double value (you subtract non-taxable pay)
    federal_additional_withholding W4
    table_used
    federal_withhold_amount Returned by function Pay Period Federal Withholding (not including supplemental)
    fica_error Returned by function Any error in Social Security calculation (see wh32.h for list)
    fica_exempt Your application From wh32.h, Social Security option
    FEDERAL_FICA_ELIGIBLE
    or FEDERAL_FICA_EXEMPT
    federal_ficamedicare_pay Your application Taxable amount for Social Security and Medicare
    previous_fica_wages_this_year Your application Pevious Social Security wages not including this paycheck
    fica_withhold_amount Returned by function Social Security withholding for this pay period
    medicare_error Returned by function Any error in Medicare calculation (see wh32.h for list)
    medicare_exempt Your application From wh32.h, Social Security option
    FEDERAL_MEDICARE_ELIGIBLE
    or FEDERAL_MEDICARE_EXEMPT
    previous_medicare_wages_this_year your application Not including this pay period
    medicare_withhold_amount Returned by function Pay period medicare withholding
    supplemental_amount your application Taxable supplemental amount
    ytd_supplemental_amount your application
    supplemental_calc_type your application From wh32.h,
    FEDERAL_SUPPLEMENTAL_FLAT_CALCULATION or FEDERAL_SUPPLEMENTAL_ADD_TO_SALARY
    supplemental_tax Returned by function Pay Period supplemental withholding
    withhold_exempt your application From wh32.h
    FEDERAL_WITHHOLD_ELIGIBLE
    or FEDERAL_WITHHOLD_EXEMPT
    w4_2020 your application Set to 1 if employee has 2020 w-4 on file
    w4_2020_step2 2020 W-4 Set to 1 if employee has checked checkbox 2c. This is used to select which one of the 2020 tables the calculation function should use.
    w4_2020_step3 2020 W-4 Value from 2020 W-4 Step 3 line 3.  This is the dependent credit (annual amount) and will be subtracted from the withholding amount by the calculation function.
    w4_2020_step4a 2020 W-4 Value from 2020 W-4 Step 4 Line 4(a).  This is other income (annual amount) and will be added to the taxable income by the calculation function.
    w4_2020_step4b 2020 W-4 Value from 2020 W-4 Step 4 Line 4(b).  this is a deduction (annual amount) and will be subtracted from taxable income by the calculation function.
        Value from 2020 W-4 Step 4 line 4(c) is passed in the structure member 'federal additional withholding'.  This amount (per pay period) is added to the calculated withholding by the calculation function.
    w4_2020_nra 2020 W-4 Set to 1 if employee has written in nonresident alient.  Calculation function will add an additional amount to the withholding amount.
    You can perform regular and supplemental calculations at the same time.

    Note: FICA and Medicare tax will automatically be calculated for supplemental income. Care must be taken in the case where pretax retirement is greater than regular pay and less than supplemental payment. In this situation FICA and Medicare could be calculated incorrectly. The safest thing to do in this situation is to calculate FICA/Medicare in a separate call the the engine and then perform the regular calculation but using the FICA/Medicare amount returned in the first calculation.

    Sample Code Snippet
    /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
    struct FEDERAL_WITHHOLDING_STRUC wh;
    struct STATE_WITHHOLDING_STRUC stwh;
    struct LOCAL_WITHHOLDING_STRUC lwh;
    struct FEDERAL_WITHHOLDING_STRUC *whpt;
    struct STATE_WITHHOLDING_STRUC *stwhpt;
    struct LOCAL_WITHHOLDING_STRUC *lwhpt;
    whpt=&wh;
    stwhpt=&stwh;
    long l;
    double fedwh;
    /* various inits of wh go here */
    l=WH32_Calc(0,whpt,stwhpt); // command=0
    fedwh=wh.federal_withhold_amount;


  • State Withholding Calculations
    You calculate Federal AND State withholding using the WH32_Calc function. Besides passing the Federal withholding information you must fill out the STATE_WITHHOLDING_STRUC to pass state information. The complete up-to-date structure is in the wh32.h file supplied as part of this package.

    All  members of the STATE_WITHHOLDING_STRUC should be initialized before calling a calculation function.  For brevity our sample code snippets will not show all members being initialized.



    Sample Code Snippet div class="code"> /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
    struct FEDERAL_WITHHOLDING_STRUC wh;
    struct STATE_WITHHOLDING_STRUC stwh;
    struct LOCAL_WITHHOLDING_STRUC lwh;
    struct FEDERAL_WITHHOLDING_STRUC *whpt;
    struct STATE_WITHHOLDING_STRUC *stwhpt;
    struct LOCAL_WITHHOLDING_STRUC *lwhpt;
    whpt=&wh;
    stwhpt=&stwh;
    long l;
    double fedwh;
    double statewh;
    stwh.state_number=WH32_ALABAMA; /* various inits of wh go here */
    l=WH32_Calc(0,whpt,stwhpt); // command=0
    fedwh=wh.federal_withhold_amount;
    statewh=stwh.state_withhold_amount;


    • Alabama
      Element Source Description
      state_number your application from wh32.h
      WH32_ALABAMA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIEDSEPARATE
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      alabama_dependents W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY

    • Sample Code Snippet
      /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
      struct FEDERAL_WITHHOLDING_STRUC wh;
      struct STATE_WITHHOLDING_STRUC stwh;
      struct LOCAL_WITHHOLDING_STRUC lwh;
      struct FEDERAL_WITHHOLDING_STRUC *whpt;
      struct STATE_WITHHOLDING_STRUC *stwhpt;
      struct LOCAL_WITHHOLDING_STRUC *lwhpt;
      whpt=&wh;
      stwhpt=&stwh;
      long l;
      double fedwh;
      double statewh;
      /* various inits of wh go here */
      /* we show state specific ones only here.*/
      stwh.state_number=WH32_ALABAMA;
      stwh.state_table=STATE_STATUS_MARRIED;
      stwh.state_allowances=2;
      stwh.alabama_dependents=1;
      stwh.state_additional_withholding=0;
      stwh.supplemental_calc_type=STATE_SUPPLEMENTAL_FLAT_CALCULATION;
      l=WH32_Calc(0,whpt,stwhpt); // command=0
      fedwh=wh.federal_withhold_amount;
      statewh=stwh.state_withhold_amount;


    • Arizona
      Element Source Description
      state_number your application from wh32.h
      WH32_ARIZONA
      arizona_withhold_percentage W4
      state_additional_withholding W4
    • Arkansas
      Element Source Description
      state_number your application from wh32.h
      WH32_ARKANSAS
      state_table not used
      state_allowances W4
      state_additional_withholding W4
    • California
      Element Source Description
      state_number your application from wh32.h
      WH32_CALIFORNIA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      california_estimated_deductions W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
      supplemental_tax_type Your application STATE_SUPPLEMENTAL_CA_BONUS_STOCK
      STATE_SUPPLEMENTAL_CA_OTHER
    • Colorado
      Element Source Description
      state_number your application from wh32.h
      WH32_COLORADO
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      stw4l1 W4 Set to 1 if new W4 filled out, 0 else
      stw4l2 W4 Set to 1 if new W4 has value(can be $0) in Line 2, 0 else
      stw4d2 W4 Value entered on line 2 of new W4 by employee
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
      stw4l1 This value is ignored for year 2019. For 2020 or greater it should be set to 1 to tell the calculation function to use the new Colorado table(which doesn't use allowances). Setting to 0 will result in old table being used. Employer has some latitude here but generally you would set to 1.
      employer_amount For Colorado this is employer aount of occupational tax for this paycheck
    • Connecticut
      Element Source Description
      state_number your application from wh32.h
      WH32_CONNECTICUT
      connecticut_filing_status W4 Ascii value for 'A', 'B', 'C', 'D', 'F'
      connecticut_reductional_amount W4 Double value
      state_additional_withholding W4
    • District of Columbia
      Element Source Description
      state_number your application from wh32.h
      WH32_DISTRICTOFCOLUMBIA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIEDSEPARATE
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      state_additional_withholding W4
    • Delaware
      Element Source Description
      state_number your application from wh32.h
      WH32_DELAWARE
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIEDSEPARATE
      state_allowances W4
      state_additional_withholding W4
    • Georgia
      Element Source Description
      state_number your application from wh32.h
      WH32_GEORGIA
      state_table G-4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED_ONE_WORKING
      STATE_STATUS_MARRIED_BOTH_WORKING
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIEDSEPARATE
      state_allowances G-4 not used on/after 2024
      georgia_dependents G-4 This is sum of G-4 lines 4 and 5
      state_additional_withholding G-4
    • Hawaii
      Element Source Description
      state_number your application from wh32.h
      WH32_HAWAII
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (version 2020.6)
      STATE_STATUS_CERTIFIED_DISABLED (version 2020.6)
      STATE_STATUS_NONRESIDENT_MILITARY_SPOUSE (version 2020.6)
      state_allowances W4
      state_additional_withholding W4
    • Idaho
      Element Source Description
      state_number your application from wh32.h
      WH32_IDAHO
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (version 2020.6)
      state_allowances For 2018 this is number elegible for child tax credit on Federal W-4 Line 5.
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Illinois
      Element Source Description
      state_number your application from wh32.h
      WH32_ILLINOIS
      state_allowances W4
      illinois_additional_allowances W4
      state_additional_withholding W4
    • Indiana
      As of Sept 15, 2023(program version 3.50) two additional fields must be passed: 1) Number of first time dependents and 2) Year of most recent W4-filing. If Year of most recent W4 filing is 0 calculation routine will set to year of calculation.
      Element Source Description
      state_number your application from wh32.h
      WH32_INDIANA
      state_allowances W4
      indiana_dependents W4 Number of Claimed Dependents (This is all dependents until Oct 1, 2022)
      stw4l2 W4 As of Sept 15, 2023 this is number of First Time Dependents
      stw4l3 W4 Year of most recent W4 Filing
      stw4l1 W4 As of Oct 1, 2022 this is number of claimed ADOPTED dependents
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Iowa
      Element Source Description
      state_number your application from wh32.h
      WH32_IOWA
      stw4l1 W4 IA W-4 2024 (or later) filed by employee>
      stw4d1 W4 For 2024 or later this is Allowance dollar amount
      state_allowances W4 For 2023 or earlier this is number of state allowances
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Kansas
      Element Source Description
      state_number your application from wh32.h
      WH32_KANSAS
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Kentucky
      Element Source Description
      state_number your application from wh32.h
      WH32_KENTUCKY
      state_additional_withholding W4
    • Louisiana
      Element Source Description
      state_number your application from wh32.h
      WH32_LOUISIANA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_NOEXEMPTION
      state_allowances W4
      louisiana_dependents W4
      state_additional_withholding W4
    • Maine
      Element Source Description
      state_number your application from wh32.h
      WH32_MAINE
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (version 2020.6)
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Maryland
      Element Source Description
      state_number your application from wh32.h
      WH32_MARYLAND
      state_table W4 STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE-STATUS_MARRIED_WITHHOLD_SINGLE
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Massachusetts
      Element Source Description
      state_number your application from wh32.h
      WH32_MASSACHUSETTS
      state_allowances W4
      massachusetts_blind W4
      special_)field_1 W4 0 = use per pay period maximum fica deduction(default)
      2 = use cummulative fica payments for maximum fica deduction
      previous_fica_wages If special_field_1 equals 2 then uses this field to calculate maximum fica deduction
      massachusetts_spouse_blind 0 = no Spouse blind exemptions
      1 = Spouse blind exemptions
      massachusetts_student 0 = no Student exemptions
      1 = Student exemptions
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Michigan
      Element Source Description
      state_number your application from wh32.h
      WH32_MICHIGAN
      state_allowances W4
      michigan_special_exemptions W4
      michigan_claim_as_dependent W4
      state_additional_withholding W4
    • Minnesota
      Element Source Description
      state_number your application from wh32.h
      WH32_MINNESOTA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (2020.6)
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Mississippi
      Element Source Description
      state_number your application from wh32.h
      WH32_MISSISSIPPI
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_BOTH_WORKING
      mississippi_exemption_amount W4 Any Double Value
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Missouri
      Element Source Description
      state_number your application from wh32.h
      WH32_MISSOURI
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_BOTH_WORKING STATE_STATUS_MARRIEDSEPARATE
      special_field_2 W4 state reductional amount (set by employee on w4 to override withholding)
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Montana
      Element Source Description
      state_number your application from wh32.h
      WH32_MONTANA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_QUALIFYINGWIDOWER
      STATE_STATUS_MARRIED_ONE_WORKING
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
      special_field_2 W4 (2024 or later) Exact Withholding amount set by employee
    • Nebraska
      Element Source Description
      state_number your application from wh32.h
      WH32_NEBRASKA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • New Jersey
      Element Source Description
      state_number your application from wh32.h
      WH32_NEWJERSEY
      newjersey_table W4 from wh32.h; ASCII value
      State Table A = 0x41
      State Table B = 0x42
      State Table C = 0x43
      State Table D = 0x44
      State Table E = 0x45
      (any other value here will force use of the status in state_table)
      state_table W4 Function uses this if element 'state_table' is blank
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_FILING_SINGLE
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_QUALIFYINGWIDOWER
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      alabama_dependents W4
      state_additional_withholding W4
    • New Mexico
      Element Source Description
      state_number your application from wh32.h
      WH32_NEWMEXICO
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (version 2020.6)
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • New York
      Element Source Description
      state_number your application from wh32.h
      WH32_NEWYORK
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (version 2020.6)
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • North Carolina
      Element Source Description
      state_number your application from wh32.h
      WH32_NORTHCAROLINA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_QUALIFYINGWIDOWER
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • North Dakota
      Element Source Description
      state_number your application from wh32.h
      WH32_NORTHDAKOTA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD (version 2020.6)
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (version 2020.6)
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption. This is not used if employee was hired on/after January 1, 2020 or was hired before that date but has filed the new 2020 W-4.
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
      stw4l1 Your application Set to 1 if employee has submitted 2020 or later W-4 OR is a new Employee. This check is used to determine table to use.
      stw4d1 2020 or later W-4 Extra Income employee may enter to adjust withholding
      stw4d2 2020 or later W-4 Extra Deductions employee may enter to adjust withholding
    • Ohio
      Element Source Description
      state_number your application from wh32.h
      WH32_Ohio
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Oklahoma
      Element Source Description
      state_number your application from wh32.h
      WH32_OKLAHOMA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_WITHHOLD_SINGLE (version 2020.6)
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Oregon
      Element Source Description
      state_number your application from wh32.h
      WH32_OREGON
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_FILING_SINGLE
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Pennsylvania
      Element Source Description
      state_number your application from wh32.h
      WH32_PENNSYLVANIA
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Puerto Rico
      Element Source Description
      state_number your application from wh32.h
      WH32_PUERTORICO
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Rhode Island
      Element Source Description
      state_number your application from wh32.h
      WH32_RHODEISLAND
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • South Carolina
      Element Source Description
      state_number your application from wh32.h
      WH32_SOUTHCAROLINA
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Utah
      Element Source Description
      state_number your application from wh32.h
      WH32_UTAH
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_additional_withholding W4
    • Vermont
      Element Source Description
      state_number your application from wh32.h
      WH32_VERMONT
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_FILING_SINGLE
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Virginia
      Element Source Description
      state_number your application from wh32.h
      WH32_VIRGINIA
      state_allowances W4
      special_field_1 W4 Number of over age 64 or blind allowances
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Virgin Islands
      Element Source Description
      state_number your application from wh32.h
      WH32_VIRGINISLANDS
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • West Virginia
      Element Source Description
      state_number your application from wh32.h
      WH32_WESTVIRGINIA
      state_allowances W4
      state_special_1 W4 0=Withhold at Low Rate
      1=Withhold at Regular Rate
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Wisconsin
      Element Source Description
      state_number your application from wh32.h
      WH32_WISCONSIN
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
  • Local Withholding Calculations
    The following local taxes are supported
    Alabama Occupational Tax
    Colorado City OCP
    Delaware Wilmington Tax
    Indiana County
    Kentucky County, School, Local Taxes
    Maryland County
    Michigan City
    Missouri City
    New York City
    Ohio School District and Municipal Taxes
    Pennsylvania Municipality and School District
    Generic percentage
    Generic Occupational Privilege Tax
    Steps required to perform local withholding calculations.
    • Use the function call WH32_Get_Prompt to get the local taxing body name AND calculation number
    • Fill out required information in FEDERAL_WITHHOLDING_STRUC
    • Fill out required information in STATE_WITHHOLDING_STRUC
    • Fill out required information in LOCAL_WITHHOLDING_STRUC
    • Make the call to WH32_Calc_Local

    Sample Code Snippet for Alabama
    /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
    struct FEDERAL_WITHHOLDING_STRUC wh;
    struct STATE_WITHHOLDING_STRUC stwh;
    struct LOCAL_WITHHOLDING_STRUC lwh;
    struct FEDERAL_WITHHOLDING_STRUC *whpt;
    struct STATE_WITHHOLDING_STRUC *stwhpt;
    struct LOCAL_WITHHOLDING_STRUC *lwhpt;
    whpt=&wh;
    stwhpt=&stwh;
    lwhpt=&lwh;
    long l;
    double fedwh;
    double statewh;
    double localwh;
    /* various inits of wh structure go here */
    /* we show state specific ones only here.*/
    stwh.state_number=WH32_ALABAMA;
    stwh.state_table=STATE_STATUS_MARRIED;
    stwh.state_allowances=2;
    stwh.alabama_dependents=1;
    stwh.state_additional_withholding=0;
    stwh.supplemental_calc_type=STATE_SUPPLEMENTAL_FLAT_CALCULATION;
    lwh.id_number=5; /*actual number returned from WH32_Get_Prompt call*/
    l=WH32_Calc_Local(0,whpt,stwhpt,lwhpt); // command=0
    fedwh=wh.federal_withhold_amount;
    statewh=stwh.state_withhold_amount;
    localwh=lwh.withhold_amount;


    Maryland 2023 and onward note:
    Counties on/after 2023 use both table (Single/Married/HofH/MARRIED_WITHHOLD_SINGLE) in their calculations.
    If there is more than one local taxing authority you can repeat the above procedure for another taxing district.

    Each state entry below tells what is required in the LOCAL_WITHHOLDING_STRUC. In general you fill out LOCAL_WITHHOLDING_STRUC the same as STATE_WITHHOLDING_STRUC. Differences are shown for each individual state.

    • WH32_Get_Prompt
      A This call exists to allow you to retrieve the name and calculation number (calc_number) of local taxing bodies (Municipal, School or other name). You will use this URL call for 2 reasons
      • Get the names of the local taxing bodies for use in user prompts
      • Get the calculation number (calc_number) of each taxing body to put in the LOCAL_WITHHOLDING_STRUC.

      Your normal use would follow this sequence:
      • Make a call to WH32_Get_Prompt with correct state and muni_type and desired_entry set to 0 in structure WITHHOLDING_TAXBODY_INFO. The Function will return name of first taxing body and, more importantly, the total number of possible names in number_of_entries
      • Now retrieve all names by calling WH32_Get_Prompt with values for desired_entry from 0 to number_of_entries-1 returned in your first call
      • For each name save the name returned and the 'calc_number'. Calc_number will be used in the WH32_Calc call (LOCAL_WITHHOLDING_STRUC member id_number)

      WH32_Get_Prompt Code Snippet
      /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/

      Next have function return total number of possible local
      taxing names in parameter number_of_entries;
      */
      wt.desired_entry=0;
      wt.muni_number=0;
      wt.state=WH32_COLORADO;
      ll=WH32_Get_Prompt(&wt,&thename[0]);
      max_entries=wt.number_of_entries;

      /*
      Now get all Colorado local prompts
      */
      for(i=0;i<max_entries;i++){
        wt.desired_entry=i;
        ll=WH32_Get_Prompt(&wt,&thename[0]);
        m_IDC_local_tax.AddString(&thename[0]);
        m_local_tax_ids[i]=wt.calc_number;
      }

      (Because some states have a lengthy list of names you will probably want to save this information locally. You should refresh the information whenever from the WH32_Version changes.)


    • Alabama Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Colorado Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Delaware Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Indiana Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Kentucky Local
      Kentucky has School, City and County withholding. In some cases if both the county and city have tax then the city takes precedence and you should not use the county tax. You can get the information needed for each type of tax by using the WH32_Get_Prompt call. Allow the user to select their tax body from these lists. Also prompt them for resident or non-resident. Then call the WH32_Calc_Local function 3 times (for county, city, school).
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      year_to_date your application Year to date taxable pay(not including this pay period)
      muni_type your application KY_LOCAL_SCHOOL, KY_LOCAL_CITY, or KY_LOCAL_COUNTY
    • Maryland Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Michigan Local
      The employer may have to withhold for two taxing bodies if they are a resident of a local taxing body other than the one they work. If so, the withholding amount due to the city of residence is returned in the structure element 'residence_withhold_amount'. Current version does not support less than 100% employment in a locality.
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      resident your application Are they a resident of the location where they are working? Options are: LOCAL_NONRESIDENT or LOCAL_RESIDENT
      residence_number your application One of entries returned by function WH32_Get_Prompt
      withhold_amount Returned by function This will be the amount to withhold for the city of employment.
      residence_withhold_amount Returned by function This will be the amount to withhold for city of residence if they live in a different taxing city than the one employed in.
    • Missouri Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • New York Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Ohio Local
      Two calculation calls must be made. One for School District tax and one for Municipal tax.
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      muni_type your application From wh32.h. Either OH_SCHOOL_DISTRICT_TAX or OH_MUNICIPAL_TAX
    • Pennsylvania Local
      For Pennsylvania you will have to make at least two calls to the function 'WH32_Calc_Local': once for Municipality and once for School District. If you want separate EIT and LST tax amounts you will need to make a separate call to get each of these- 2 calls for School District and 2 for Municipality. You will need to pass the calculation id_number for both school district and municipality.  Generally you will get this number by having payroll personnel select school and municipal district by name and using the calculation number you get using the WH32_Get_Prompt function.   An invalid code will cause the error code 'WH32_LOCAL_NOTABLE' to be returned.
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      muni_type your application From wh32.h. PA_LOCAL_MUNICIPAL (returns both EIT and LSt)
      PA_LOCAL_MUNICIPAL_EIT (returns only EIT)
      PA_LOCAL_MUNICIPAL_LST (returns only LSt)
      PA_LOCAL_SCHOOL (returns both EIT and LSt)
      PA_LOCAL_SCHOOL_EIT (returns only EIT)
      PA_LOCAL_SCHOOL_LST (returns only LST)
      EIT/LST versions available from version 2020.6 on
      resident your application From wh32.h LOCAL_NONRESIDENT or LOCAL_RESIDENT
      table your application From wh32.h #define PA_LOCAL_OPT_PAYPERIOD (calculates LST on pay period basis) or #define PA_LOCAL_OPT_ANNUAL (calculates LST on annual basis)
    • Generic Percentage
      This calculation uses new elements of the 'LOCAL_WITHHOLDING_STRUC'. The operator should be prompted for these new elements. If the 'percent_amount' is non-zero this calculation will takes precendence over any other state local calculation except for generic Occupational Privilege Tax.
      Element Source Description
      percent_amount your application Fixed rate percent multiplied by taxable income. 7% should be sent as 0.07.
      maximum your application Maximum annual local percent withholding tax allowed. Leave zero if none.
      year-to-date your application Year-to-date Local withholding not including current paycheck
      number_of_exemptions your application Number of local personal exemptions used when calculating percent tax
      exemption_amount your application Annual dollar exemption for each personal exemption when calculating percent tax
      fixed_allowance_amount your application Annual dollar value subtracted from taxable income before percent tax calculation.
    • Generic Occupational Privilege Tax
      This calculation uses new elements of the 'LOCAL_WITHHOLDING_STRUC'. This tax is intended for local taxing bodies which have a fixed dollar amount tax, such as an Occupational Privilege Tax. If this field is non-zero it takes precedence over all other local taxes. The operator should be prompted for any Occupational Privilege Tax. and this amount put in the field 'annual_opt'.
      Element Source Description
      annual_opt your application Annual dollar amount of fixed type taxes such as occupational privilege tax.
  • Canadian Withholding Calculations
    To use the Canadian withholding functions you will have to use various structures. These are defined in the file wh32_canada.h supplied with the Withholding32 package.

    The function you will use to calculate Canada Federal and Provincial withholding is WH32_Canada_Calc. You will pass it the structures CANADA_FEDERAL_WITHHOLDING_STRUC and CANADA_PROVINCIAL_WITHHOLDING_STRUC. Next we show what needs to be placed into these structures before making the call.

    Other than common elements (e.g. struct_size, etc) here are the CANADA_FEDERAL_WITHHOLDING_STRUC elements you need to fill in
    Element Source Description
    federal_table_date your application Date you want calculation to be for.
    claim_amount TD1 Long integer value containing number of pay periods per year
    prescribed_zone_deduct TD1 Dollar amount.
    income_less_than_claim TD1 Suggested Prompt: "Is your total income less than claim amount?" In this Long value put a 1( CANADA_INCOME_LESS_THAN_CLAIM) for yes or 0 for no.
    labor_sponsored_corporation_deduction your application Employer will be notified of this amount
    other_federal_credits your application Additional credits such as charitable deduction and medical expenses requested by an employee. Suggested Prompt: "Other Employee authorized credits"
    ccp_eligible_months your application Supplied by employer. Number of months (1 through 12) under ccp.
    current_taxable_bonus your application Gross bonus minus pretax
    previous_taxable_bonus your application Gross amount minus pretax (not including current)
    provincially_registered_LSVCC your application


    CANADA_PROVINCIAL_WITHHOLDING_STRUC
    Element Source Description
    province_id your application from wh32_canada.h
    claim_amount TD1 Total claim amount. Suggested prompt: "TD1 Total Claim Amount"
    prescribed_zone_deduct your application
    labor_sponsored_corporation_deduction your application
    other_provincial_credits your application
    current_taxable_bonus your application
    previous_taxable_bonus your application
    disabled_dependents TD1 (used only by Ontario)
    dependents_under_18 TD1 (used only by Ontario)


    The (optional) WH32_Canada_Get_CC will return Federal and Provincial Claim Codes is useful for TD1 processing.
  • State Disability Insurance Calculations
    The function SDI_Calc returns State Disability Insurance Tax information. SDI is supported for California, Hawaii, New Jersey, New York, Puerto Rico and Rhode Island.


    When calling the function SDI_Calc you will have to pass the structure SDI_WITHHOLDING_STRUC. That structure is defined in the included sdi.h file. Here is how it should be filled out.
    Element Source Description
    sdi_pay your application Pay subject to SDI
    sdi_pay_ytd your application hould be the year-to-date sdi taxable pay not including the current amount. Employee withholding will be returned in 'sdi_amount'
    sdi_employer_rate your application is used to calculate employer contribution if non-zero. At this time this is used only for New Jersey. The rate varies by employer and must be passed to the calculation function. The employer contribution is returned in 'sdi_employer_amount'.
    sdi_employee_rate your application s used only if non-zero. Ordinarily we use the employee contribution rate from our database. You may override this by putting in a rate here (i.e. .005 would be 1/2 of 1%)
    period your application Is used by Hawaii and New York to calculate maximum contribution per pay period. If you do not use the expanded SDI Withholding Structure which includes this field then calculations will be as before.
    famleave_amount returned by function
    special_2 returned by function (employee contribution for Washington as of version 2019.00)
  • Federal Unemployment Calculations
    The function FUTA_Calc returns Federal Unemployment Insurance Tax information.


    When calling the function FUTA_Calc you will have to pass the structure FUTA_WITHHOLDING_STRUC. That structure is defined in the included futa.h file. Here is how it should be filled out.
    Element Source Description
    futa_pay your application Pay subject to FUTA
    futa_pay_ytd your application hould be the year-to-date futa taxable pay not including the current amount.
    futa_employer_rate your application is used to calculate employer contribution if non-zero.
  • State Unemployment Calculations
    The function SUI_Calc returns State Unemployment Insurance Tax information. SUI is supported for all states.


    When calling the function SUI_Calc you will have to pass the structure SUI_WITHHOLDING_STRUC. That structure is defined in the included sui.h file. Shown below are the parts that need to be filled out. As of version 2019.00 the wage base for Rhode Island depends on the employer rate.
    Element Source Description
    sui_pay your application Pay subject to SUI
    sui_pay_ytd your application hould be the year-to-date suta taxable pay not including the current amount.
    sui_employer_rate your application is used to calculate employer contribution if non-zero. The rate varies by employer and must be passed to the calculation function. The employer contribution is returned in 'sui_amount'. A rate of 1% would be passed as .01
    payperiods your application pay periods per year
    sui_ytd your application sui previously withheld this year
    sui_employee_rate your application rate for employee subtracted SUI contribution (1% would be entered as .01)

    Returned values are
    Element Source Description
    sui_amount Employer amount to withhold
    sui_employee_amount Employee amount to withhold
    sui_special2 State Wage Base used (introduced in version 2019.20)
  • California ETT Calculations
    The function ETT_Calc returns California ETT Employer Tax.


    When calling the function ETT_Calc you will have to pass the structure ETT_WITHHOLDING_STRUC. That structure is defined in the included ett.h file. Here is how it should be filled out.
    Element Source Description
    ett_pay your application Pay subject to ETT
    ett_pay_ytd your application hould be the year-to-date suta taxable pay not including the current amount.
  • Oregon Transportation Tax Calculations
    The function TT_Calc returns Oregon Transportation Taxes. There may be local tax (you provide the rate) which is employer paid and effective July 1, 2018 there is a statewide employee paid transit tax with a fixed rate (we provide). The local tax is employer paid (returned in element tt_amount of structure TT_WITHHOLDING_STRUC) and the new 2018 tax is employee paid (returned in element tt_ee_amount of structure TT_WITHHOLDING_STRUC). See tt.h


    When calling the function TT_Calc you will have to pass the structure TT_WITHHOLDING_STRUC. That structure is defined in the included tt.h file. Here is how it should be filled out.
    Element Source Description
    tt_pay your application Pay subject to ETT
    tt_pay_ytd your application Not used.
    tt_er_rate your application rate ( 1% = .01)
  • Various State Calculations
    The function StateOther_Calc is defined from 2022.01 onward. It is proved for future state calculations. Current version only calculates Washington Cares employee withholding. See soc.h


    When calling the function StateOther_Calc you will have to pass the structure STATEOTHER_WITHHOLDING_STRUC. That structure is defined in the included soc.h file. Here is how it should be filled out for state of Washington to return Washington Cares employee withholding(first available 2022.01).
    Element Source Description
    state your application WH32_WASHINGTON
    command your application STATEOTHER_WACARES
    table_date your application Month, day, year of calculation
    long1 your application Pay Periods per Year
    double1 your application Pay this pay period
    double2 calculated value amount to withhold this pay period for this employee
    error returned by function STATEOTHER_NOERROR
    orSTATEOTHER_ERROR1
  • Family Leave Calculations
    The function FAMLEAVE_Calc returns Family Leave Tax. (Colorado(as of 2023), Connecticut, District of Columbia, Massachusetts, New York, New Jersey, Oregon(as of 2023) and Washington)


    When calling the function FAMLEAVE_Calc you will have to pass the structure FAMLEAVE_WITHHOLDING_STRUC. That structure is defined in the included famleave.h file. Here is how it should be filled out.
    Colorado Specific Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_COLORADO
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Received from function. Employee Withholding for Family
    special_1 Sent to function. Employer percent of entire family leave withholding.
    special_2 Received from function. Employer Withholding for Family leave
    special_3 Not Used
    special_4 Not Used
    special_5 Not Used
    Connecticut Specific Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_CONNECTICUT
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Received from function. Employee Withholding for Family
    special_1 Not Used.
    special_2 Not Used
    special_3 Not Used
    special_4 Not Used
    special_5 Not Used
    District of Columbia Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_DISTRICTOFCOLUMBIA
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Received from function. Employee Withholding for Family (always 0)
    special_1 Not Used.
    special_2 Received from function. Employer Withholding for Family leave
    special_3 Not Used
    special_4 Not Used
    special_5 Not Used
    Massachusetts Specific Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_MASSACHUSETTS
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Employee Withholding for Family returned by function
    special_1 Sent to function. Employer percent of entire family leave withholding. Employee percent would then be 1-this amount. Note that Massachusetts may restrict this number in which case the function will use the what state regulations allow
    special_2 Sent to function. Number of Employees (new for 2023)
    Received from function. Employer Withholding for Family leave
    special_3 Sent to function. Employer percent of entire medical leave withholding. Employee percent would then be 1-this amount. Note that Massachusetts may restrict this number in which case the function will use the what state regulations allow
    special_4 Received from function. Employer Withholding for Medical Leave
    special_5 Received from function. Employee Withholding for Medical Leave
    New York Specific Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_NEWYORK
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Received from function. Employee Withholding for Family
    special_1 Not Used.
    special_2 Not Used
    special_3 Not Used
    special_4 Not Used
    special_5 Not Used
    New Jersey Specific Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_NEWJERSEY
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Received from function. Employee Withholding for Family
    special_1 Not Used.
    special_2 Not Used
    special_3 Not Used
    special_4 Not Used
    special_5 Not Used
    Oregon Specific Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_OREGON
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Received from function. Employee Withholding for Family
    special_1 Not Used.
    special_2 Not Used
    special_3 Not Used
    special_4 Not Used
    special_5 Not Used
    Washington Specific Family Leave Instructions
    Inteface
    Element
    Usage
    State WH32_WASHINGTON
    famleave_Pay Pass to function
    famleave_Pay_ytd Pass to function
    famleave_amount Received from function. Employee Withholding for Family
    special_1 Sent to function. Employer percent of family leave withholding
    special_2 Returned from function. Emplohyer withholding
    special_3 Not Used
    special_4 Not Used
    special_5 Not Used
  • Workers Compensation Calculations
    The function WORKCOMP_Calc returns Workers Compensation Tax.


    When calling the function WORKCOMP_Calc you will have to pass the structure WORKCOMP_WITHHOLDING_STRUC. That structure is defined in the included workcomp.h file. Here is how it should be filled out.
    Element Source Description
    state your application From wh32.h
    state_info1 your application 0=hourly, 1=salaried
    state_info2 your application Number of previous paychecks this month
    workcomp_pay your application not used
    workcomp_pay_ytd your application Not used.
    workcomp_hours your application hours worked for hourly employees
    workcomp_rate1 your application employee dollar per hour rate
    workcomp_rate2 your application employer dollar per hour rate
    state_data1 your application not used
    state_data2 your application not used
  • Gross-Up Calculations
    Withholding32 contains a 'Gross-Up' option. This allows you to specify a given take-home payment and have Withholding32 calculate the gross pay required to achieve it. This works for both regular and supplemental payments and all Federal, State and Local withholding except for Ohio and Pennsylvania.

    The command word passed to WH32_Calc and WH32_Calc_Local is used to determine the type of gross up calculation performed.

    1) When calling WH32_Calc or WH32_Calc_Local set command = WH32_COMMAND_GROSSUP_REGULAR (defined in wh32.h)

    Set federal_taxable_pay to the desire NET pay. The same field will return the gross pay required to meet your goal. All other members of the various structures passed should be set up as normal.

    For a given desired net paycheck the library will calculate the gross regular pay required to meet this. You may have an additional amount in supplemental but this amount will not be adjusted. The required gross regular pay required to meet your target net pay will be returned in structure element federal_taxable_pay (as well as state/local/fica)

    2) In WH32_Calc or WH32_Calc_Local set command = WH32_COMMAND_GROSSUP_SUPPLEMENTAL (in wh32.h)

    Set supplemental_amount to the desire NET supplemental. The same field will return the gross supplemental required to meet your goal. All other members of the various structures passed should be set up as normal.

    For a desired net supplemental amount, the library will calculate the gross supplemental required to meet this. You may list a regular pay amount also, but the regular pay amount will not be adjusted. The required gross supplemental amount required to meet your target will be returned in supplemental_amount (in fed/state/local)

    It is possible that the library may not be able to arrive at an exact solution.  In this case the appropriate returned fields will be set to the closest possible and the federal structure error member will be set to WH32_GROSSUP_DID_NOT_CONVERGE (100).

    Fed/state/local/fica taxable pay must be the same when you call the function. This new feature does not work for Ohio or Pennsylvania.
  • Error Codes
    Calculation Functions (like WH32_Calc) can return two types of errors. The function itself returns an error and within structures passed to the function will be an error memeber. Errors which can be returned from function are shown here. These can be "or'd" together so more than one flag may be set at a time.
    #define WH32_RETURN_FEDERAL_ERROR 1
    #define WH32_RETURN_FICA_ERROR 2
    #define WH32_RETURN_MEDICARE_ERROR 4
    #define WH32_RETURN_STATE_ERROR 8
    #define WH32_RETURN_COUNTY_ERROR 16
    #define WH32_RETURN_LOCAL_ERROR 16
    #define WH32_RETURN_CITY_ERROR 32
    #define WH32_RETURN_SUPPLEMENTAL_ERROR 64;

    Federal Errors which can be returned from 'error' member of structure. Only one of these will be returned at a time.
    #define WH32_FEDERAL_NOTABLE 1
    #define WH32_FEDERAL_STRUCT_ERROR 2
    #define WH32_FEDERAL_ILLEGAL_PERIOD 3
    #define WH32_GROSSUP_DID_NOT_CONVERGE 100;

    State Errors which can be returned from 'error' member of structure
    #define WH32_STATE_NOTABLE 1
    #define WH32_ARIZONA_ILLEGALPERCENT 2
    #define WH32_STATE_NOSTATE 3
    #define WH32_STATE_STRUCT_ERROR 4(the structure you are passing to the function is not the latest version required by the function. You should verify you are using the latest wh32.h file.

    Local Errors which can be returned from 'error' member of structure
    #define WH32_LOCAL_NOTABLE 1