Skycorr is an instrument-independent sky subtraction code that uses physically motivated line group scaling in the reference sky spectrum by a fitting approach for an improved sky line removal in the object spectrum. Possible wavelength shifts between both spectra are corrected by fitting Chebyshev polynomials and advanced rebinning without resolution decrease. For the correction, the optimized sky line spectrum and the automatically separated sky continuum (without scaling) is subtracted from the input object spectrum. Tests show that Skycorr performs well (per cent level residuals) for data in different wavelength regimes and of different resolution, even in the cases of relatively long time lags between the object and the reference sky spectrum. Lower quality results are mainly restricted to wavelengths not dominated by airglow lines or pseudo continua by unresolved strong emission bands.