Skip to content

Instantly share code, notes, and snippets.

@bemitc
Last active September 21, 2025 11:48
Show Gist options
  • Select an option

  • Save bemitc/3cda3b32dbca687a3b8f0360f81eb68e to your computer and use it in GitHub Desktop.

Select an option

Save bemitc/3cda3b32dbca687a3b8f0360f81eb68e to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import sys
# Simple script to estimate how much of your early ira withdrawl
# will be left after taxes. It uses 2025 breakpoints from the following
# web page: https://www.usbank.com/wealth-management/financial-perspectives/financial-planning/tax-brackets.html
#
# State tax is based on a flat 5.49% tax
# and a single standard deduction is used
#
# These are pretty individualized to me, so you may beed to change then
def tax_state(gross):
taxable = gross - 12000
return taxable * 0.0519
def tax_fed(taxable):
tax = 0.0
for i in range(1, taxable + 1):
if i < 11925:
tax = tax + (1 * 0.1)
elif i >= 11925 and i < 48475:
tax = tax + (1 * 0.12)
elif i >= 48475 and i < 103350:
tax = tax + (1 * 0.22)
elif i >= 103350 and i < 197300:
tax = tax + (1 * 0.24)
elif i >= 197300 and i < 250525:
tax = tax + (1 * 0.32)
elif i >= 250525 and i < 626350:
tax = tax + (1 * 0.35)
else:
tax = tax + (1 * 0.37)
return tax
withdraw_amount = int(sys.argv[1])
after_taxes = withdraw_amount
std_deduction = 15750
penalty = withdraw_amount * 0.1
taxable = withdraw_amount
if taxable >= std_deduction:
taxable = taxable - std_deduction
taxable = round(taxable)
state = tax_state(withdraw_amount)
fed = tax_fed(taxable)
after_taxes = after_taxes - (state + fed + penalty)
print(f'fed={fed}, state={state}, penalty={penalty}')
print(round(after_taxes))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment