In order to investigate the formation mechanisms of the rare compact elliptical galaxies (cE) we have compiled a sample of 25 cEs with good SDSS spectra, covering a range of stellar masses, sizes and environments. They have been visually classified according to the interaction with their host, representing different evolutionary stages. We have included clearly disrupted galaxies, galaxies that despite not showing signs of interaction are located close to a massive neighbour (thus are good candidates for a stripping process), and cEs with no host nearby. For the latter, tidal stripping is less likely to have happened and instead they could simply represent the very low-mass, faint end of the ellipticals. We study a set of properties (structural parameters, stellar populations, star formation histories and mass ratios) that can be used to discriminate between an intrinsic or stripped origin. We find that one diagnostic tool alone is inconclusive for the majority of objects. However, if we combine all the tools a clear picture emerges. The most plausible origin, as well as the evolutionary stage and progenitor type, can be then determined. Our results favor the stripping mechanism for those galaxies in groups and clusters that have a plausible host nearby, but favors an intrinsic origin for those rare cEs without a plausible host and that are located in looser environments.