Optics naturally provides us with some powerful mathematical operations. Here we experimentally demonstrate that during reflection or refraction at a single optical planar interface, the optical computing of spatial differentiation can be realized by analyzing specific orthogonal polarization states of light. We show that the spatial differentiation is intrinsically due to the spin Hall effect of light and generally accompanies light reflection and refraction at any planar interface, regardless of material composition or incident angles. The proposed spin-optical method takes advantages of a simple and common structure to enable vectorial-field computation and perform edge detection for ultra-fast and energy-efficient image processing.