The short answer
To convert MP3 to M4B, join the MP3 files in order, re-encode them to AAC, and add a chapter for each file plus a cover. Our free MP3 to M4B tool does it in your browser without uploading; on any computer, ffmpeg does it with the commands below.1,2 iTunes, Audacity and VLC can make AAC files, but not one chaptered audiobook.4,6
- Easiest
- In your browser
- Chapters
- One per MP3
- Good quality for speech
- AAC 64 kbps
- Cost
- Free
In your browser (no install)
Open the MP3 to M4B tool
It runs in your browser; nothing is uploaded, so a 20-hour book doesn’t wait on an upload.
Drop the book’s MP3 files
Drop them all at once, or a folder. Files are sorted by track number and name; drag to reorder. Each file becomes a chapter named from its tag or file name.
Check chapters, cover and details
Rename chapters, join a file to the one before it, add a cover and fill in title, author and narrator.
Choose quality and convert
Voice (64 kbps mono) is about 29 MB an hour and plenty for speech. Download one .m4b with chapters.
With ffmpeg (Windows, Mac, Linux)
ffmpeg is free and does the whole job in one command, given two text files: a list of the MP3s in order, and the chapters. These commands were tested with ffmpeg 6.1.
1. List the files in order
The concat reader takes a file list; every file must have the same codec settings.1
file '01 - Chapter 1.mp3'
file '02 - Chapter 2.mp3'
file '03 - Chapter 3.mp3'2. Write the chapters
ffmpeg’s metadata format starts with ;FFMETADATA1; each [CHAPTER] has a time base, start and end (here in milliseconds) and a title. Characters such as = ; # \ in titles need a backslash before them.1
;FFMETADATA1
title=My Book
artist=Author Name
album=My Book
genre=Audiobook
[CHAPTER]
TIMEBASE=1/1000
START=0
END=10000
title=Chapter 1
[CHAPTER]
TIMEBASE=1/1000
START=10000
END=20000
title=Chapter 23. Convert
-map_chapters 1 takes the chapters from the second input.2 ffmpeg writes both a QuickTime chapter track and Nero chapters into the M4B, so most players see them.1
ffmpeg -f concat -safe 0 -i list.txt -i chapters.txt \
-map 0:a -map_metadata 1 -map_chapters 1 \
-c:a aac -b:a 64k -movflags +faststart book.m4bWith a cover image, and marked as an audiobook (media_type=2):
ffmpeg -f concat -safe 0 -i list.txt -i chapters.txt -i cover.png \
-map 0:a -map 2:v -map_metadata 1 -map_chapters 1 \
-c:a aac -b:a 64k -c:v copy -disposition:v:0 attached_pic \
-metadata media_type=2 -movflags +faststart book.m4bOr build the chapters from a folder automatically
This bash loop (Mac, Linux, or Windows with WSL or Git Bash) makes one chapter per MP3, named after the file, timed from each file’s duration:
: > list.txt
printf ';FFMETADATA1\ntitle=My Book\nartist=Author Name\ngenre=Audiobook\n' > chapters.txt
t=0
for f in *.mp3; do
printf "file '%s'\n" "${f//\'/\'\\\'\'}" >> list.txt
d=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$f")
ms=$(awk -v d="$d" 'BEGIN{printf "%d", d*1000}')
printf '\n[CHAPTER]\nTIMEBASE=1/1000\nSTART=%d\nEND=%d\ntitle=%s\n' "$t" "$((t+ms))" "${f%.mp3}" >> chapters.txt
t=$((t+ms))
done
ffmpeg -f concat -safe 0 -i list.txt -i chapters.txt \
-map 0:a -map_metadata 1 -map_chapters 1 -c:a aac -b:a 64k -movflags +faststart book.m4bOther ways, and their limits
| One M4B file | Chapters | Cover | Free | |
|---|---|---|---|---|
| Our MP3 to M4B tool | Yes | Yes | Yes | Yes |
| ffmpeg | Yes | Yes | Yes | Yes |
| Audiobookshelf (server) | Yes | Yes | Yes | Yes |
| Apple Music / iTunes | No | No | Per track | Yes |
| Audacity | As .m4a | No | No | Yes |
| VLC | No | No | No | Yes |
- Apple Music and iTunes convert with File, Convert, Create AAC Version, which makes one .m4a per track.4 iTunes for Windows can set a track’s media kind to Audiobook so it remembers your place.5
- Audacity exports M4A (AAC) once its optional FFmpeg library is installed, and AAC beats MP3 at the same size, but its documentation doesn’t cover writing chapters.6,8
- Audiobookshelf, a free self-hosted audiobook server, can “merge your audio files into a single m4b”.7