Smoke testing is a preliminary test or check that verifies if the most crucial aspects of a product are working, whereas sanity testing aims to establish if a product is in the working state users expect. The primary objective of smoke testing is to verify basic functionalities, while sanity testing focuses on determining if the product works roughly as expected after it's already built. Smoke tests assess the entire product from end to end but are not in-depth, whereas sanity tests cover key parts and dive deeper into specific areas. Sanity testing is usually undocumented and unscripted, typically carried out by QA testers or developers in a formalized setting.