How Do I Convert Files Without Losing Quality?
The potential loss of quality looms, regardless of your reasons for converting between audio formats. Thankfully the degradation of our media need not be necessary, though. There are surefire ways of avoiding loss during audio format conversions. How is this achieved?
To convert files without losing quality, the target format must be lossless and have a sufficient bit depth and sample rate. Lossless formats include:
- Free Lossless Audio Codec (FLAC)
- Apple Lossless Audio Codec (ALAC)
- WavPack (WV)
- Wave Audio File Format (WAV)
This list is not exhaustive; the best target format will depend on your needs. Whether any given conversion is worthwhile also hinges on several factors. Furthermore, what about MP3 or AAC files? And what conversion software should you use? Let’s dive in.
How To Convert Audio Files Without Losing Quality?
Avoiding loss in quality during audio conversion from one representation to another primarily depends on the resulting representation, not the source. Picking the target format is the crux of the matter. Crucially, the target format must be lossless.
Once you know which format is best for you, we’ll provide some options for performing the conversion, depending on your needs. Some will be easier to use, others will be more flexible, with extra features.
The conversion software or website only makes a quality difference insofar as it allows you to choose the parameters used for conversion, as long as the transcoding is correct. However, when converting to a lossless format, the defaults for popular converters are usually sufficient. Often, you will be given a choice, so it’s best to know your way around the selection of bit depth and sample frequency.
Which Formats Are Lossless?
There are plenty of lossless formats, but they are not all equal in their functionality. In addition, some formats are better suited for specific devices. Below, we’ll unpack the options so you can determine which lossless formats will best serve your needs.
WAV (.wav)
The Wave Audio File Format, shortened to “Wave” or “WAV” after the standard file extension, was developed by IBM and Microsoft as a container for audio data. Technically, WAV files can contain a variety of different audio encodings, including lossy encodings such as MP3. However, WAV almost always holds linear PCM (Pulse Code Modulation) nowadays and thus serves as a straightforward format to work with.
WAV is the primary choice for uncompressed audio on the Windows operating system, but it has widespread support across all consumer computer platforms and is ubiquitous.
Due to being uncompressed, it’s a popular format among audio editing professionals (as the file can be edited without decoding/re-encoding) and audiophiles (due to it being lossless and well-supported). However, it tends to have excessive file sizes, which makes it a poor choice for long-term storage or transfer.
AIFF (.aiff)
AIFF is essentially the Apple counterpart to the WAV file format. AIFF stands for Audio Interchange File Format, and like WAV, it is based on IFF, which was initially developed by Electronic Arts and Commodore in 1985. The format helped identify the kind of data a file contained, facilitating data sharing between companies.
Unlike WAV, AIFF only supports uncompressed PCM. However, a variant of the format called AIFF-C offers a limited number of rudimentary compression schemes. So, while AIFF is less diverse than WAV in theory, you know what you’re getting.
FLAC (.flac)
The Free Lossless Audio Codec is among the most well-supported and one of the most popular compressed lossless formats. It was initially released in the early 2000s by Josh Coalson. It was later handed over to the Xiph organization (whose portfolio includes Ogg, Vorbis, Opus, Speex, and Theora formats). It has many advantages:
- It’s a free and openly-developed format.
- It has widespread software and hardware support.
- Decoding and encoding are rapid among compressed formats.
- It achieves close to the industry-best lossless compression ratios.
FLAC takes up about 50% to 60% of the space compared to the equivalent WAV file or raw PCM. This is much better than ZIP (often 95%+ of the space) but much worse than MP3 (about 10% to 20% of the size of the PCM representation). Of course, unlike MP3, it is excellent for archival and audiophiles, as it supports conversion and playback without significant loss.
One drawback to FLAC is that it isn’t supported by iTunes or iOS. The only option is to use third-party media players like VLC Media Player.
ALAC (.alac)
Apple Lossless Audio Codec, often called Apple Lossless or ALAC, is much like FLAC. It was released in 2004, a few years after FLAC’s release, and was subsequently open-sourced in 2011. It also aims to compress audio losslessly and achieves similar results to FLAC. However, it isn’t FLAC’s equal.
ALAC enjoys first-class support from Quicktime and iTunes, but it’s less ubiquitous outside the Apple ecosystem. ALAC has slightly worse compression ratios on average while being much slower to decode on playback (listening is not affected, but the extra computational cost may deplete device power more quickly). Furthermore, ALAC does not feature error checking, unlike FLAC.
Nonetheless, Apple continues to champion ALAC in its services, such as lossless streaming of music via Apple Music, as an alternative to lossy AAC (although because the AAC is by default at a reasonably high bitrate, 256 kilobits a second, the difference may be imperceptible).
WavPack (.wv)
WavPack, not to be confused with packs of WAVs, is one of the most feature-filled lossless compression formats. Development on WavPack began in mid-1998, and to this day, David Bryant continues to improve the format and its codec.
.
The features of WavPack include:
- Free and open source.
- Edges out FLAC on average lossless compression in specific tests, with ratios as low as 30%.
- In hybrid lossy/lossless mode, a lossy file and a correction file are generated, allowing recovery.
- Efficient decoding and encoding.
- Software support across all consumer platforms and beyond.
- Supports exceptionally high resolutions and DSD audio.
- Highly flexible in varieties of PCM, it can encode.
There’s much more in there for audio enthusiasts to play around with. Although, WavPack has the significant caveat that 3rd party support is less prevalent than for FLAC or even ALAC. While it is recommended for its technical advantages, FLAC will likely be easier for most people to use in their everyday life.
Monkey’s Audio (.ape)
Monkey’s Audio is a codec notable for giving WavPack’s compression ratios a run for their money. While the codecs are free to download, they have been closed-source since release in 2000.
However, the percent or so advantage Monkey’s Audio has is not without cost. It is relatively slow to decode or encode, consuming more time and power. It isn’t suitable for use on portable media players or old iPods. The format is also relatively niche, so don’t expect support from all of your media software.
Bottom line: Monkey’s Audio is perfect for saving as much space as possible, but you’ll pay for it in time and electricity.
WMA Lossless (.wma)
Windows Media Audio is a set of proprietary codecs developed by Microsoft for their operating system. This codec is also closed-source. It was initially touted as a superior alternative to MP3, but a lossless codec was later added to the fold, called WMA Lossless.
However, it is difficult to recommend WMA. Its compression is inefficient compared to FLAC and has relatively little support outside the Windows operating system.
Other Lossless Audio Codecs
Here’s a quick rundown of three others of particular note:
- OptimFROG is a proprietary codec that sacrifices speed for marginally better ratios.
- Shorten is a precursor, its academic contribution paving the way for FLAC and WavPack.
- Meridian Lossless Packing is a technique used in DVD and Blu-ray discs to fit large media.
How To Convert To A Lossless Format
Once you have chosen a lossless format to convert to, we can finally perform the audio conversion. While there are a wide variety of software and online solutions for converting between audio files, they mostly fall under the category of online converters, GUI software converters, or command line converters.
Using Online Audio Converters
Almost every modern consumer device supports browsing the web, making online audio converters readily accessible while also being very easy to use. There are various options, such as:
This is how you would go about the conversion to FLAC using Convertio:
- Open up their webpage.
- Click on the central “Choose Files” button.
- Select the file. Note that you can use Ctrl+Click or Shift+Click to select multiple.
- To the left of each file, choose the format you wish to convert to by its file extension (FLAC).
- Check the conversion settings using the gear button (the defaults should be reasonable).
- You can add more files using the buttons below. Else select “Convert.”
- The files will then be uploaded, converted, and then become downloadable.
- Download them individually or as a ZIP archive, and then you’re done.
Using FFmpeg
Command line programs may be a bit obtuse to use. Still, FFmpeg is one of the most feature-complete, cross-platform, and flexible tools available for media conversion. It may come in a pinch or handle obtuse cases while providing power users with a reliable and scriptable solution.
Installing FFmpeg via the downloads on their website is unintuitive, so we recommend the following.
- Windows users may find the redistribution on the Microsoft Store most convenient.
- On MacOS, open the terminal and run the following command:
brew update && brew upgrade && brew install ffmpeg - On Linux, use your distribution’s package manager, e.g., sudo apt install ffmpeg
Once FFmpeg is installed, open up PowerShell via the search bar on Windows or the Terminal on Mac, while Linux users can open their preferred terminal emulator. Then, check that FFmpeg is installed by running ffmpeg, which should display its default configuration.
If all looks good, the following command is all you need:
ffmpeg -i ./folder1/folder2/file1.ext ./folder3/folder4/file2.flac
Switch out “file1.ext” to the name and extension of your file (like “song.mp3” or “music.wav”) and rename “file2.flac” to the desired file name and file format extension (as listed in the headings of the formats covered above). The file path must also be changed to the correct folder names.
FFmpeg will then take care of the rest.
What Is Sound Quality, Anyway?
Sound quality may seem like a very vague notion. How do we preserve something we don’t understand? Thankfully, there are helpful ways of looking at it constructively in order to judge different tracks more objectively and see what needs to be done.
The main idea is fidelity: how closely does the reproduced sound wave resemble the original? This is easy to measure: subtract the amplitude of one wave from the other, and the size of the residual remainder gives us the gist. When the quality is reduced, distortions are added, and frequencies may be left out. Therefore the new sound (and the data) diverges from the “ideal” original recording.
Sound quality measures extend much further than this, as human auditory systems find some audio information more critical than the rest. However, we’ll be using quality and fidelity interchangeably going forward.
Why Do Some Audio Conversions Decrease Quality?
Certain audio file conversions reduce quality as they discard information about the original waveform, which decreases audio fidelity. This is what causes the quality issues that arise when using the MP3 format. This, of course, does not apply to all conversions, but why?
The key is to look at the target format. Lossy formats aim to maximize compression. To do this, they throw away “less important” information to reduce the size of the resulting file until it reaches a target data threshold (usually defined by bit rate, the number of bits used per second).
This is far from a necessary step, but what information do we really need to keep?
What Is Digital Sound, Fundamentally?
Digital sound is just a digital representation of a waveform. Sound is inherently analog, which is continuous, while digital data is discrete. The PCM encoding is a de facto standard for overcoming this, acting as a bridge format between all kinds of software and hardware.
PCM stands for Pulse Code Modulation. In plain English, PCM is a list of regular samples of a waveform over time, like a histogram or bar chart. Amplitude readings are taken repeatedly to build up a PCM sequence, and each measurement is saved as a number corresponding to the height. The resulting file is a list of those numbers.
Note that not all PCM is the same. Even though they all correspond to PCM, two lossless files might use different sample rates (number of samples per second) and sample depth (number of bits per sample). Higher rates and depths can increase quality but result in a size increase too.
If you need to specify the sample rate and depth during a conversion, using the original file’s sample rate and depth is best. This might be hard to determine, but CD Digital Audio quality is a good default. CD-DA uses PCM encoding with a sample rate of 44.1 kHz and 16 bits of depth. Going above this will increase the file size without making much difference on anything but Hi-Fi systems.
Is It Possible To Reduce File Size Without Losing Quality?
Compressed, lossless formats reduce file size while accurately encoding all of the input information without loss. That is to say, you can convert from PCM to the format and always convert back to the same (or very similar) PCM data. This starkly contrasts against lossy formats, where the round trip loses information, and the original cannot be recovered.
Here are the various cases:
- Lossless to lossless: no loss in quality.
- Lossy to lossless: no loss in quality.
- Lossless to lossy: loss in quality.
- Lossy to lossy: loss in quality.
Of course, one way to make a lossless format is to write the PCM to a file, add a little bit of metadata (data about the data), and call it a day. This is more or less what some lossless formats do, and it has advantages. However, this takes up a lot of space. MP3 was invented because it reduced the space needed by a factor of 10 while still sounding quite good.
However, you can compress data without losing information. ZIP files are a great example, as you can compress any file, the result is usually much smaller, and then unzip the file to restore the original perfectly. While the DEFLATE algorithm used by ZIP files is very ineffective at compressing PCM, there are more special-purpose ways of encoding audio to cut file sizes in half.
Should You Convert To A Lossless Audio Format?
It doesn’t always make sense to convert to a lossless audio format. There are two main reasons why you shouldn’t, even if you can.
Firstly, you can never increase the fidelity of a given file without additional information about the original recording or sound. For example, converting from MP3 to FLAC will never recover any quality; it will only keep the information that is already there. However, the FLAC file will be considerably larger.
Second, while lossy formats won’t keep all the information at 256 kbps to 320 kbps bit rate, they are effectively “transparent,” implying the loss is practically impossible to hear. At these bit rates, you’re still saving a lot of space over even OptimFROG or WavPack, without a noticeable difference.
Conclusion
If you must convert the file without losing quality, lossless files are the way to go, and doing so is quick and convenient. However, make sure it makes sense to use a lossless format, as lossy formats such as AAC or Opus may still be best for you.