For domestic mainline travel: 22"
For international: 19"
For some domestic regional planes: neither will fit.
If you don't mind gate-checking now and then: 22"
In the last scenario you should have a small bag ready to pull out for cabin use (containing valuables, medicines, etc) if asked to gate check the larger one.
A black swan suggestion: Consider a non-wheeled shoulder bag. Having to carry it will encourage you to pack light. It will squeeze into every bin; nobody will ask you to gate check it. I have one from BR (now discontinued) and Red Oxx, but there are many good choices. Read around here or at onebag.com .