To quote Joel Spolsky (being more succinct than I would be):
"Anything you do on your own time, with your own equipment, that is not related to your employer’s line of work is yours, even if the contract you signed says otherwise."
(For California only)
So as usual, it's a bit more complex, but the key is whether it's related to your employer's line of work. Of course the employer may try to claim _anything_ to belong to them, but they may not prevail in court. That outcome is less than ideal for the employee - best not talk about side projects at work or do anything related to them at work.
https://www.joelonsoftware.com/2016/12/09/developers-side-pr...