United States
The IRS provides a handy tool which will calculate your US federal taxes. Just answer their questions and at the end they'll let you know what your taxes will be. They'll also provide an adjusted W4 so you'll get the refund you want.
https://www.irs.gov/individuals/tax-withholding-estimator

US States Income Tax Information
https://www.usa.gov/state-taxes

Canada
Use the Payroll Deductions Online Calculator (PDOC) to calculate federal, provincial (except for Quebec), and territorial payroll deductions. It will confirm the deductions you include on your official statement of earnings.
https://www.canada.ca/en/revenue-agency/services/e-services/e-services-businesses/payroll-deductions-online-calculator.html

Did this answer your question?