Use chdman createcd for CUE/BIN and GDI disc images: the conversion is lossless, and Recalbox’s chdman guide says the file is typically half the size. Run chdman verify and boot the game from the CHD before you delete any original. CHD is a format for disc images, not for cartridge ROMs (MAME’s documentation says it was designed around mass storage media), so a folder of cartridge dumps has nothing to convert.
chdman createcd -i "game.cue" -o "game.chd"
chdman createcd -i "game.gdi" -o "game.chd"
MAME’s documentation describes CHD files as “designed very specifically around the needs of mass storage media”, meaning hard disks, CD-ROMs, DVDs and LaserDiscs. That is the scope of this guide: discs you own and have already dumped. The order below follows the risk. Choose the command, install the tool, convert one disc, prove it, then scale up.
Don't miss new tech stories on Google
Add Tech Insider once in the Google app and our stories appear in your news suggestions.
Match the command to the file in front of you
The MAME chdman manual gives the basic syntax as chdman <command> <option>..., and createcd builds a CD-ROM image. Recalbox’s own example passes the .cue to createcd and says CHD merges a multi-track image into a single file.
| You hold | Command | Systems that take the CHD |
|---|---|---|
| CUE plus BIN files (CD) | createcd -i game.cue | Recalbox lists 3DO, Amiga CD32, Amiga CDTV, Dreamcast, Mega CD, Neo-Geo CD, PC Engine CD, PlayStation and Saturn |
| GDI plus its track files (Dreamcast) | createcd -i game.gdi | Dreamcast |
| ISO (DVD image, for example PlayStation 2 disc games) | createdvd -i game.iso | The MAME manual lists createdvd as the command that creates a CHD DVD-ROM image, and Recalbox says ISO is the format PlayStation 2 disc games use. Check that emulator’s own documentation for whether it reads CHD before converting a library |
| GameCube or Wii disc | Not covered here | See the Dolphin setup guide for the formats that emulator reads |
| Cartridge ROM | None | MAME describes CHD as designed for mass storage media such as hard disks, CD-ROMs, DVDs and LaserDiscs |
Recalbox’s supported-systems list is the one to check, and it warns: “Not every CD system supports CHD.” Its advice is to read the _readme.txt in the system’s rom folder, which lists the extensions that system accepts. Onion’s documentation calls CHD the preferred format for Sega CD, PlayStation and PC Engine games.
Installing chdman on Windows, macOS and Linux, and why the version matters
On Windows, chdman.exe ships inside MAME’s release download. Per Recalbox, you go to mamedev.org/release.html, download the latest 64-bit release and extract it, since the file is a self-extracting archive. Run chdman.exe from that folder, or add the folder to your PATH so any terminal finds it. On macOS and Linux a package manager is simpler:
# macOS (Homebrew formula rom-tools)
brew install rom-tools
# Debian, Ubuntu
sudo apt install mame-tools
# Fedora
sudo dnf install mame-tools
The rom-tools formula on Homebrew provides chdman, and Recalbox gives macOS 10.13 High Sierra as the minimum. If your Linux distribution has no mame-tools package, Recalbox says to run make tools in the MAME source, after which chdman is in the build directory. Put that folder on your PATH so the command works from anywhere:
# replace /opt/mame-tools with the folder that holds chdman
export PATH="$PATH:/opt/mame-tools"
Take the newest build you can get. Recalbox reports that on a ten-track Mega-CD game, version 0.257 takes about 1 minute where 0.269 takes 35 seconds. Against 60 seconds, that is 41.7% less time, or 1.7 times as fast. It is one game and one report, so read it as a sign that old packages are slower, not as a speed guarantee.
If you would rather not install anything, Onion’s documentation points to a browser version at chdman.com that runs entirely in your browser, and describes its own cue2chd script: put the CUE/BIN images in the chdman folder, run cue2chd, then copy the resulting .chd files to the rom folder. Either route produces the same kind of file. The proof steps below still apply to it.
Convert one disc first and read what info prints
Before running anything, put every BIN named in the CUE, or every track named in the GDI, beside the index file. CHD, in Recalbox’s words, “merges a multi-track image into a single file”, so a missing track means a CHD with missing data. Quote any path that contains spaces.
chdman createcd -i "Game.cue" -o "Game.chd"
chdman createcd -i "Game.gdi" -o "Game.chd"
chdman info -i "Game.chd"
Per the MAME manual, info reports the compression algorithms, compressed and uncompressed sizes with the overall compression ratio, the hunk size and SHA1 digests. A ratio close to no saving on a disc you expected to shrink is a reason to look at the source before going further.
On macOS and Linux, a small helper in your shell profile saves retyping. It converts one disc and prints the name of the CHD it made; run verify on that file next.
convert_chd() {
local infile="$1"
local subcmd="$2"
local outfile="${infile%.*}.chd"
chdman "$subcmd" -i "$infile" -o "$outfile" && echo "CHD created: $outfile"
}
# convert_chd "Game.cue" createcd
Three options are worth knowing, and the defaults cover the rest:
- Compression and hunk size. The manual says
createcddefaults to cdlz,cdzl,cdfl and, with no parent CHD, to eight sectors per hunk, which is 19,584 bytes (2,448 bytes per sector). It adds that larger hunks may compress better but slow small random reads. An emulator makes many small reads, so leave both alone. - –numprocessors. It limits the threads used for compression. Lower it if the machine must stay usable during a long run.
- –force. It overwrites existing output files. Leave it off, so a rerun cannot replace a CHD that was already good.
Prove the CHD before the original goes
Three checks, in this order, decide whether a source image can be deleted. First, chdman verify -i "Game.chd". The manual states that the input must be a read-only CHD and that the command “modifies its input file” when --fix (or -f) is given. Run verify without --fix. If you ever need the repair option, run it on a copy.
Second, for the first disc of each system, rebuild the image and compare it. Recalbox says the conversion is lossless, so you can rebuild the original .bin and .cue byte for byte. Extract into a fresh folder, then compare the BIN with your original. If your original set has one BIN per track, a single-file compare does not apply, so rely on verify and the boot test instead.
# macOS / Linux
mkdir check
chdman extractcd -i "Game.chd" -o "check/Game.cue"
cmp "Game.bin" "check/Game.bin" && echo identical
# Windows
mkdir check
chdman extractcd -i "Game.chd" -o "check\Game.cue"
fc /b "Game.bin" "check\Game.bin"
Third, load the CHD in the emulator. Recalbox’s instruction is short: “Check that each .chd actually starts before deleting the original files.” Do this for the first disc of each system and for any game you care about.
Two traps remain. For PlayStation games protected by LibCrypt, Recalbox says to keep the .sbi files and put them next to the .chd, or the games will not start, so they travel with the CHD when you copy it to the emulator folder. And do not zip the results: the MAME documentation says CHDs are already compressed and should not be stored in ZIP or 7-Zip archives, and that keeping them in folders is best, since an archived CHD forces MAME to load the whole file into memory.
A batch that stops cleanly instead of half-finishing
Recalbox’s loop, for f in *.cue; do chdman createcd -i "$f" -o "${f%.cue}.chd"; done, works, but it keeps going after a failure, can leave a half-written CHD behind and does not look in subfolders. The script below adds what a library run needs. It stops at the first error, removes the partial CHD on error or Ctrl-C, skips any CHD that already exists, verifies each file straight after creating it, does not use --force and never deletes a source. Save it as chd-batch.sh and run it with bash.
#!/usr/bin/env bash
# Usage: bash chd-batch.sh cue ./PS1
# bash chd-batch.sh gdi ./Dreamcast
set -eu
ext=${1:?need cue or gdi}
dir=${2:?need a folder}
partial=""
cleanup() {
if [ -n "$partial" ] && [ -f "$partial" ]; then
rm -f -- "$partial"
echo "Removed partial file: $partial"
fi
}
trap cleanup EXIT
trap 'exit 1' INT TERM
while IFS= read -r -d '' src; do
out="${src%.*}.chd"
if [ -e "$out" ]; then
echo "Skipping, CHD exists: $out"
continue
fi
partial="$out"
echo "Converting: $src"
if chdman createcd -i "$src" -o "$out" && chdman verify -i "$out"; then
echo "OK: $out"
else
echo "FAILED: $src"
exit 1
fi
partial=""
done < <(find "$dir" -type f -iname "*.$ext" -print0)
echo "Conversion finished. Originals were left in place."
The CHD is written beside its source, so Dreamcast games stored one folder each are handled by the recursive find. If power fails mid-run the trap cannot fire, so run chdman verify on the newest CHD before trusting it. On Windows, the plain form of the same loop, for one folder and with no safety checks, is:
@echo off
for %%f in (*.cue) do chdman createcd -i "%%f" -o "%%~nf.chd"
echo Done.
pause
For a whole library, save the next script as chd-batch.bat in the top folder. It uses /r to walk subfolders and stops at the first failure; for GDI images change *.cue to *.gdi.
@echo off
setlocal
for /r %%f in (*.cue) do (
if exist "%%~dpnf.chd" (
echo Skipping, CHD exists: %%~dpnf.chd
) else (
echo Converting %%f
chdman createcd -i "%%f" -o "%%~dpnf.chd"
if errorlevel 1 (
echo FAILED: %%f
if exist "%%~dpnf.chd" del "%%~dpnf.chd"
exit /b 1
)
chdman verify -i "%%~dpnf.chd"
if errorlevel 1 (
echo VERIFY FAILED: %%~dpnf.chd
del "%%~dpnf.chd"
exit /b 1
)
)
)
echo Finished. Originals were left in place.
pause
Multi-disc games need no special handling in the loop: each disc gets its own CHD, and you keep the names consistent, for example Final Fantasy IX (USA) (Disc 1).chd. For RetroArch, the Libretro disc-image guide says to list the CHD filenames in a plain-text .m3u file, one per line, saved in the same folder, and to load the .m3u rather than Disc 1. Doing so, it says, “keeps one set of saves for the whole game, and lets you switch discs from the Quick Menu.” Other emulators and frontends set their own grouping rules, so check their documentation before you rename anything.
| Symptom | Likely cause | Fix |
|---|---|---|
| Tracks missing from the game, or chdman cannot find a file | A track named in the CUE or GDI is not beside it | Put every track in the folder with the index and convert again |
| chdman will not write the file | A CHD with that name already exists and --force was not used | Run verify on the existing file. Delete it yourself only if it fails |
| A PlayStation game will not start after the move | The .sbi file for a LibCrypt title was left behind | Copy the .sbi next to the .chd |
| The frontend does not list the game | The system or extension is not accepted | Read _readme.txt in the system’s rom folder |
| Verify reports an error | The CHD is damaged or incomplete | Delete it, convert again from the original and verify again. Use --fix only on a copy |
| The batch stops partway | chdman returned an error, for instance a bad source or a full disk | Fix the cause and rerun. Finished CHDs are skipped |
Disk space and time for 500 GB, 1 TB and 3 TB libraries
Published savings are loose. Onion says you can get “up to 50%” smaller files, and Recalbox says the file is typically half the size. Both are general statements, not measurements of a particular disc, so the budget below uses half as the planning figure and treats it as the best case. Discs full of already-compressed video are likely to shrink less, which is an expectation, not a measured result. The number that decides whether the batch fits is the peak: the script keeps every original until you delete it, so originals and CHDs coexist. The table is our own arithmetic on that planning figure, not a set of measured conversions.
| Library of originals | CHDs at half size | Peak if every original stays (1.5x) | Ceiling if nothing shrinks (2x) |
|---|---|---|---|
| 500 GB | 250 GB | 750 GB | 1,000 GB |
| 1 TB | 500 GB | 1.5 TB | 2 TB |
| 3 TB | 1.5 TB | 4.5 TB | 6 TB |
If the drive cannot hold the peak, convert one console folder at a time. Verify that folder, boot-test a sample, delete its originals and move on. Free space then only needs to cover the CHDs for one folder, about half of that folder’s size at the planning figure.
Time is harder to forecast. Using the single Mega-CD report above, an assumed batch of 100 discs at 35 seconds each comes to 3,500 seconds, about 58 minutes, and at 60 seconds each to 6,000 seconds, or 100 minutes. This is an illustration of one data point. A larger disc and a slower processor will both take longer than the ten-track Mega-CD game in that report.
Getting the image back, and the discs to leave alone
The conversion is reversible. Recalbox gives chdman extractcd -i "mygame.chd" -o "mygame.cue" for CHD to BIN and CUE, and the Arch Linux man page says extractcd can write a CDRDAO .toc/.bin, a CDRWIN .bin/.cue or a Dreamcast .GDI. Extract into an empty folder, so nothing needs --force to overwrite it. The same man page describes a copy command that copies all hunks of data from one CHD file to another, with no need for the hunk sizes to match; see that page for its options before using it on an older CHD.
Leave an image as it is when the emulator or frontend for that system does not list CHD, and check _readme.txt or the emulator’s documentation first. Per the MAME documentation, a delta CHD stores just the parts that differ from its parent, and the parent must be present; MAME uses them for clone systems and clone software items. The commands here do not supply a parent. Convert only discs you own, dumped with your own drive.
For your first disc of each system, work in this order. Run createcd, read info, run verify, extract and compare the BIN, and boot it. Only then run the batch on one console folder, and delete originals folder by folder. The Flycast setup guide picks up with Dreamcast CHDs.




