This is a rather objective take on how analog music recordings stack up to digital. Admittedly there are many more wrinkles to this question than what’s brought up here, but it’s fair to compare LPs with CDs.
When talking about other digital formats: MP3 is always worse than CD, but typically unhearably so at higher bit rates (go for 320 if you rip your CDs). FLAC and and other non-lossy formats are as good as the format they were compressed from (that’s what non-lossy means), typically CDs, but increasingly also Blu-ray.
Off-topic, but as it’s a hobby of mine and involving technology somehow, it’s here.