Yes. Investing online on well known platforms like M1 Finance and Betterment is considered safe. In fact, online brokerages use safe tools on their platforms so the investors can feel ultimate comfort when investing.