On this page
DocumentationGuides

Calculate Australian take-home pay

Choose the base pay definition and supply one checked pay period, gross amount and tax-free-threshold choice.

TypeScript
import { calculateSafe } from "taxkit";
import { AuPayTakeHomeCalculation } from "taxkit/au";
import { TakeHomeScenarioInputSchema } from "taxkit/au/schemas";
import { fromDecimal, nonNegative } from "taxkit/money";
import { Result } from "effect";

const input = Result.gen(function* () {
  const grossPay = yield* fromDecimal("1654.00").pipe(
    Result.flatMap(nonNegative)
  );
  return TakeHomeScenarioInputSchema.make({
    grossPay,
    period: "weekly",
    taxFreeThresholdClaimed: true,
  });
});
if (Result.isSuccess(input)) {
  const result = await calculateSafe(AuPayTakeHomeCalculation, input.success);
  if (Result.isSuccess(result)) {
    result.success.netPay.cents;
  } else {
    result.failure._tag;
  }
}

For salary sacrifice use TakeHomeWithSacrificeScenarioInput and AuPayTakeHomeWithSacrificeCalculation. The applied sacrifice is required and appears in the report's cash-pay equation. Native STSL packs additionally require their debt-status fact.