Can I withdraw money from a 529 plan for unplanned emergencies?
Yes. Just about every 529 plan permits you to take the funds back for yourself at any time and for any reason. Subject, of course, to tax and 10% penalty on the earnings portion. This flexibility should relieve any concerns you might otherwise have about "giving" your money away now. Other types of gifts (trusts, family partnerships, UGMA/UTMA accounts, etc.) are not revocable, making the 529 plan unique in this respect.
Even though your contributions to a 529 plan are revocable, those contributions are treated as completed gifts from you to the 529 account beneficiary, and the 529 account value is removed from your taxable estate.
Learn about 529 plans
World's Simplest College Calculator
The simplest way to estimate college costs.