Atom chips provide a versatile quantum laboratory for experiments with ultracold atomic gases1. They have been used in diverse experiments involving low-dimensional quantum gases2, cavity quantum electrodynamics3, atom–surface interactions4, 5, and chip-based atomic clocks6 and interferometers7, 8. However, a severe limitation of atom chips is that techniques to control atomic interactions and to generate entanglement have not been experimentally available so far. Such techniques enable chip-based studies of entangled many-body systems and are a key prerequisite for atom chip applications in quantum simulations9, quantum information processing10 and quantum metrology11. Here we report the experimental generation of multi-particle entanglement on an atom chip by controlling elastic collisional interactions with a state-dependent potential12. We use this technique to generate spin-squeezed states of a two-component Bose–Einstein condensate13; such states are a useful resource for quantum metrology. The observed reduction in spin noise of -3.7±0.4dB, combined with the spin coherence, implies four-partite entanglement between the condensate atoms14; this could be used to improve an interferometric measurement by -2.5±0.6dB over the standard quantum limit15. Our data show good agreement with a dynamical multi-mode simulation16 and allow us to reconstruct the Wigner function17 of the spin-squeezed condensate. The techniques reported here could be directly applied to chip-based atomic clocks, currently under development18.