mp3toolbox.com
← Blog

Does Re-saving a File Lose Quality?

Twenty generations of a JPEG and twenty of an MP3, measured at every step. The two answers are not the same.

Short answer: for JPEG, almost all the damage happens on the first save — nineteen further saves added only 3% more error. For MP3 the damage accumulates on every pass: after twenty encodes the error was roughly 14 times the first generation. The common advice treats both the same. It should not.

"Every time you save a JPEG it gets worse" is one of the most repeated claims about digital images, and under ordinary conditions it is largely false. The equivalent claim about audio is true. Here are the measurements.

Method

JPEG: a real photograph, 927 × 1648, decoded and re-saved at quality 85 up to twenty times with no editing and no change of dimensions. Error reported as root-mean-square difference per channel against the original on the 0–255 scale, using Pillow 11.3.

MP3: two 60-second 16-bit 44.1 kHz stereo sources — a speech-like signal and a tonal one — encoded at 192 kbps CBR, decoded back to PCM and re-encoded, up to twenty times, with FFmpeg 6.1.1. Error reported as RMS difference against the original PCM, converted to dBFS, with an offset search to remove encoder-delay misalignment.

Neither test edits the content between generations. That is deliberate: it isolates the cost of the save itself, which is the thing people worry about.

JPEG: the first save is the one that counts

SavesFile size · RMS error · as % of scale
1401.0KB · 4.649 · 1.82%
2401.0KB · 4.675 · 1.83%
3401.0KB · 4.698 · 1.84%
5401.0KB · 4.736 · 1.86%
10400.9KB · 4.779 · 1.87%
20400.9KB · 4.788 · 1.88%

The first save introduced 4.649 of error. The next nineteen together added 0.139 — a 3.0% increase. The file size did not drift either, staying within 0.1KB across all twenty generations.

The reason is that JPEG compresses by transforming each 8×8 block of pixels into frequency coefficients and rounding them to a grid determined by the quality setting. When you re-save at the same quality, those already-rounded values round to the same grid points. The operation is close to idempotent: the second pass mostly reproduces what the first pass produced.

When this stops being true

The near-immunity depends on nothing disturbing the block grid or the quantisation table. It breaks if you:

  • Crop by an amount that is not a multiple of 8 pixels, shifting every block boundary.
  • Resize or rotate by an arbitrary angle, which recomputes every pixel.
  • Change the quality setting, which changes the grid the coefficients round to.
  • Edit the pixels at all — paint, adjust levels, apply a filter.

So "re-saving a JPEG destroys it" is wrong for an untouched re-save and right for an edit-and-save cycle. The folklore conflates the two.

MP3: every pass costs you again

Error against the original PCM, in dBFS. More negative is better; each 6 dB is roughly a doubling.

EncodesSpeech-like · Tonal · multiple of generation 1
1−55.3 dBFS · −41.3 dBFS · 1.0×
2−49.8 dBFS · −35.5 dBFS · ~1.9×
3−46.5 dBFS · −32.1 dBFS · ~2.8×
5−42.4 dBFS · −27.9 dBFS · ~4.6×
10−37.1 dBFS · −22.5 dBFS · ~8.5×
20−32.3 dBFS · −17.7 dBFS · ~14.7×

The pattern is close to linear accumulation: roughly double by the second generation, four and a half times by the fifth, fifteen times by the twentieth. The file size never changed — all twenty generations were 1,441,376 bytes, because the bitrate is constant. Size tells you nothing about how many times audio has been through an encoder.

An MP3 encoder does not re-quantise an existing grid the way JPEG does. It decodes to waveform, runs a psychoacoustic model over that waveform to decide what can be discarded, and encodes afresh. Because the waveform it analyses has already been altered by the previous pass, the model reaches different conclusions and discards a different set of detail. Nothing lines up, so nothing is spared.

The tonal source degraded faster than the speech-like one at every generation, which fits: steady tones are where lossy audio coding artefacts are most exposed.

The direct comparison

Extra error from 19 further passesJPEG q85, untouched: +3%
MP3 192k, speech: +1,321%
MP3 192k, tonal: +1,420%

Same experiment, same number of repetitions, four hundred times the difference in outcome.

What this means in practice

  • Opening and re-saving a JPEG untouched is not the disaster it is described as. Avoid it where you can, but one accidental re-save has not ruined your photograph.
  • Editing a JPEG repeatedly is a real cost. Keep an original and re-export from it rather than editing the export.
  • Never re-encode audio from a lossy copy. Converting MP3 → MP3, or MP3 → AAC, stacks a second full generation of loss. Go back to the WAV, FLAC or the original download.
  • Converting a lossy file to FLAC or WAV does not undo anything. It freezes the damage at its current level and makes the file bigger, which is occasionally useful before editing and never an improvement.
  • File size does not reveal generation count. A twentieth-generation 192 kbps MP3 is the same size as a first-generation one.

Operations that cost nothing at all

Some changes do not touch the compressed data, so they carry zero generational loss however many times you repeat them:

  • Editing image metadata. EXIF lives in a separate marker segment from the image data. Our metadata editor rewrites that block and copies the compressed pixels through byte for byte.
  • Changing DPI. Set DPI rewrites a handful of bytes in the JFIF header and EXIF resolution tags. The pixels are untouched.
  • Editing MP3 tags. ID3 is a container around the audio frames, not part of them.
  • Lossless audio conversion. FLAC to WAV and back reproduces the samples exactly.

If a tool makes you wait while it "processes" a metadata change, it is probably decoding and re-encoding, and charging you a generation for a text edit.

Related guides

Summary

The two best-known lossy formats behave in opposite ways under repetition, and the advice that treats them alike is wrong about one of them. An untouched JPEG re-save is nearly free, because the second pass rounds to the grid the first pass already used. An MP3 re-encode is never free, because the encoder starts its analysis over on audio that has already been damaged. Keep originals for both — but if you only have the energy to be careful about one, be careful about the audio.

Edit metadata without re-compressing ← Back to Blog