Put in one expiring option and your account type. You'll see the shares you end up with, whether your account can hold them, and what it costs — before the closing bell decides for you. It all runs in your browser, and nothing is stored.
Why this exists. This week a $48 put in a small margin account sat about 3% from its strike the day before expiration. If the stock had closed below the strike, the put would have auto-exercised into a short position worth about $21,000 — in an account holding a few hundred dollars. The same kind of put in a Roth IRA can't turn into a short at all; the broker has to close it, at its price. Neither outcome shows up in the option's price. This page does the arithmetic out loud.
The rules it uses
Exercise by exception. The OCC automatically exercises equity options that finish at least $0.01 in the money unless a Do Not Exercise instruction is sent. Your broker's threshold can differ. Options Industry Council
The 5:30pm ET deadline. Exercise instructions for expiring options are due to your broker by 5:30pm ET on expiration day, and many brokers set an earlier cutoff. The stock can keep moving after the 4pm close. FINRA
Shorts need margin. A short stock position needs a margin account with 50% of its value up front and at least $2,000 of equity. Cash and retirement accounts can't hold one. FINRA Rule 4210
Buying the shares. About 50% of the cost in a margin account; the full cost in a cash or retirement account.
Brokers act first. Many brokers close at-risk expiring positions in the last hour of trading when an account can't support the result — at their price, not yours. Check your broker's policy.
What it doesn't do: multi-leg spreads, index options (cash-settled), early assignment before expiration, or your broker's own house margin rules, which can be stricter than the minimums above.