Convert Audio with macOS's Built-in afconvert

Core Audio's afconvert handles WAV to M4A/AAC and many other conversions without installing ffmpeg.

macOSaudioafconvertaacLow risk
Run `afconvert -f m4af -d aac input.wav output.m4a` to convert a WAV file to AAC in an M4A container.

01Command

Command
$ afconvert -f m4af -d aac input.wav output.m4a

02What it does

afconvert requires two flags in a fixed order: -f selects the container (m4af, caff, wave, aiff) and -d the data format (aac, alac for lossless, pcm variants). It powers the conversion behind many Apple apps, so codec support is exhaustive — `afconvert -hf` lists every high-grade format pair. Common extras: -b 192000 to set the AAC bitrate and --soundcheck-generate for gapless metadata.

03Risk

RiskLow risk
RequirementsBuilt-in on macOS.
!Warning: Flag order matters — swapping -f and -d positions is the classic reason afconvert reports 'Error: cannot determine format'.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Media

06Related solutions