Legal exceptions that could lower what you actually owe
Three fixed situations, not jurisdiction-specific — the underlying law here is either federal (same everywhere) or too inconsistently sourced state-by-state to present as a clean table.
The calculation above may not apply to you at all
Under the federal Servicemembers Civil Relief Act (SCRA), an active-duty service member — or an activated Reserve/National Guard member on orders over 30 days — who receives permanent-change-of-station or deployment orders of 90+ days can terminate a residential lease with no early termination fee or penalty, regardless of what the lease says. This overrides everything calculated above. You'll need to give written notice plus a copy of your military orders to your landlord; the lease then ends 30 days after the next rent payment is due following that notice.
Your landlord's duty to re-rent ("duty to mitigate")
Most US states legally require a landlord to make a reasonable effort to re-rent the unit once you leave early. Once a replacement tenant's rent starts, your obligation to keep paying generally stops — which is why the number above is a worst case, not necessarily what you'll actually owe.
Two independent legal sources agree that landlords in Arkansas, Florida, Mississippi, Pennsylvania, and Vermont are not required to do this by law (though a lease or local practice may still lead them to). For every other state, this is most likely required — but sources materially disagree on the specifics in a handful of states (Georgia, New Hampshire, South Dakota, Wyoming, and Minnesota among them), so we're not stating a confirmed answer for those five, or for any state not named above. Ask your landlord directly, or check your specific state's tenant rights resources.
Other common exceptions
Many states also allow early termination without penalty for documented domestic violence situations, or if the unit becomes legally uninhabitable — no heat, no running water, and similar — and the landlord fails to fix it within a reasonable time after notice. These exceptions vary significantly by state, so we're not listing which ones apply where.
If the uninhabitable-unit exception might apply to you, Kibbo's Habitability Issue Checklist walks through documenting the problem and notifying your landlord properly before you rely on it.