This year I plan to hand calculate the taxes in parallel to Turbotax. I will try to mess around with the instruction worksheet examples for capital gains.

Consider building your own spreadsheet, unless that's what you already meant by "hand calculate".

And just checking: which MAGI?

I had no idea there are so many different versions of MAGI. Well, you learn something new every day.

I am thinking of my taxes as the following pseudo-code:

AGI = __function_of__(W2_income, dividends, 401k, HSA)

AGI_state = __function_of__(AGI, 529)

MAGI = __function_of__(AGI, standard_deduction)

MAGI_state = __function_of__(AGI_state, standard_deduction)

TAX_state_NY = NY_TAX(MAGI_state)

TAX_state_CT = CT_TAX(MAGI_state, _credit_for_state_local_taxes_already_paid_to_NY)

TAX_federal = FED_TAX(MAGI, credit_for_state_and_local_taxes)

I'm sure there are open source libraries for tax calculations, but my goal is to understand on my own. So I'll try building some excel with formula for the above, or something else.

For some reason, I've worked on *so* many financial/accounting systems, but have never worked on the tax calculation side of things. So that is a bit of a mystery to me. Tell me to do an NPV calc and I have done that many times. Taxes - never! :-(