Yes. If you don't feel comfortable taking a bath with strangers, no worries - look for the private onsens. Some ryokans(Japanese-style inns) offer private onsens where you can reserve 1 hour or so for 1000 yen or more(sometime free of charge). Ask for a "kazoku-buro"(family onsen) or "kashikiri"(private use).
If you are not a budget traveler, look for the rooms which comes with an onsen bath. Then, you can enjoy onsen at anytime without worrying about the strangers!
Though, I strongly recommend the public onsens(the local onsens) that the local people use daily. It should be interesting to see how the locals communicate in the onsen tub. Public onsens are usually cheap with good onsen water.