A Python tool to convert Magic: The Gathering deck lists from Moxfield format to Forge format, with special support for Commander/EDH decks.
- Converts Moxfield deck exports (text or JSON) to Forge-compatible
.dckfiles - Automatically detects Commander/EDH decks (100-card singleton format)
- Handles set codes and collector numbers
- Normalizes promo set codes (removes 'P' prefix for Forge compatibility)
- Preserves special markers and foil indicators
- Supports both regular and Commander deck formats
moxfield_to_forge.py # Main converter script
lists/ # Directory containing Moxfield deck exports
├── convert # Batch conversion script
├── zurgo.txt # Example: Mardu Surge deck
├── valgavoth.txt # Example: Rakdos pain deck
├── edgar.txt # Example: Vampire tribal
├── elas.txt # Example: Aristocrats deck
├── elfs.txt # Example: Elf tribal
├── braids.txt # Example: Aristocrats variant
├── vren2.txt # Example: Dimir rats
├── hakbal.txt # Example: Merfolk explorers
├── hearthhull.txt # Example: Jund lands
├── toph.txt # Example: Gruul lands combo
├── toph2.txt # Example: Gruul lands variant
├── toph3.txt # Example: Gruul lands casual
├── sephiroth.txt # Example: Mono-black aristocrats
├── greengoblin.txt # Example: Rakdos reanimator
├── hashaton.txt # Example: Esper reanimator
├── axonil.txt # Example: Mono-red burn
└── axonil2.txt # Example: Mono-red burn variant
# Basic usage
./moxfield_to_forge.py input.txt output.dck
# With flags
./moxfield_to_forge.py -i deck.txt -o converted.dck
# Override deck name
./moxfield_to_forge.py -i deck.txt -o output.dck --name "My Awesome Deck"Use the lists/convert script to convert multiple decks at once:
cd lists
./convertThis script converts all deck lists in the lists/ directory using predefined deck names.
./moxfield_to_forge.py --demoThe converter accepts Moxfield deck exports in text format:
1 Card Name (SET) 123
2 Another Card (SET2) 456 *F*
1 Double-Faced Card / Other Side (SET3) 789
Format details:
- Quantity at the start of each line
- Card name
- Set code in parentheses (e.g.,
(LCI),(DSK)) - Optional collector number
- Optional special markers (e.g.,
*F*for foil)
The converter generates Forge .dck files:
[metadata]
Name=Deck Name
[Commander]
1 Commander Card|SET|[123]
[Main]
1 Card Name|SET|[456]
2 Another Card|SET2|[789]
For Commander decks:
- First card becomes the Commander
- Remaining 99 cards go in the Main section
- Automatically detected for 100-card singleton decks
For regular decks:
- All cards go in the Main section
- Optional Sideboard section
The converter automatically handles promo set codes:
PBLB→BLBPMKM→MKMPDMU→DMU
usage: moxfield_to_forge.py [-h] [-i INPUT_FILE_ALT] [-o OUTPUT_FILE_ALT]
[-n NAME] [--demo] [--version]
[input_file] [output_file]
positional arguments:
input_file Input Moxfield deck file (.txt or .json)
output_file Output Forge deck file (.dck)
optional arguments:
-h, --help show this help message and exit
-i, --input INPUT_FILE_ALT
Input Moxfield deck file (.txt or .json)
-o, --output OUTPUT_FILE_ALT
Output Forge deck file (.dck)
-n, --name NAME Override deck name in the output file
--demo Run with sample deck data and display output
--version show program's version number and exit
Convert the Zurgo Mardu Surge deck:
./moxfield_to_forge.py lists/zurgo.txt ~/.forge/decks/commander/zurgo.dckConvert with custom name:
./moxfield_to_forge.py -i lists/valgavoth.txt -o valgavoth.dck --name "Endless Pain"- Python 3.6 or higher
- No external dependencies required
This is a utility script for personal use with Magic: The Gathering deck management tools.