Refinancing costs are a summary of closing fees and other additional fees.
Cost of refinancing = closing cost + all the required fees.
You can determine how many months it takes to recoup the money you spend on refinancing by simply dividing the monthly savings by your total closing costs. But for more precise calculations, use online calculators. They will assist you in figuring out your costs and monthly payments.