We use density functional theory to characterize how size affects the relative stability of thin NiTi slabs of different crystal structures and its implication on the martensitic phase transition that governs shape memory. We calculate the surface energies of B2' phase (austenite), B19 (orthorhombic), B19' (martensite) and a body centered orthorhombic phase (BCO), the theoretically-predicted ground state. We find that (110) B2 surfaces with in-plane atomic displacements stabilize the austenite phase with respect to B19' and BCO, thus slabs with such orientations are predicted to exhibit a decrease in martensite transition temperature with decreasing thickness. Our calculations predict a critical thickness of 2 nm, below which the transition would not occur. The opposite trend is observed in slabs with atomic displacements along the surface normal: the phase transformation temperature increases with decreasing size.