Sorry for delayed response. It totally depends on how you format. If you are using the built in recovery partition, it would go back to the original factory settings i.e. Windows 8.1 (if that's what came preinstalled). If you use a Windows 10 ISO to format the HDD, it will install Windows 10. Even if you get Windows 8.1, you can always upgrade to Windows 10.