MySQL to Magic Converter

Transform MySQL database dumps into Magic: The Gathering deck lists

MySQL Input

Magic Deck Output

About MySQL to Magic Converter

Convert MySQL database dumps (CREATE TABLE and INSERT statements) to Magic: The Gathering deck list format. Perfect for managing card collections, deck lists, and tournament submissions stored in MySQL databases.

Key Features

  • Standard Deck Format: Generates the standard "Quantity CardName" format used by MTG platforms
  • Automatic Parsing: Extracts quantity and card name from MySQL data
  • Column Detection: Uses first column as quantity, second as card name
  • Default Quantity: Assumes quantity of 1 if only card name is provided
  • File Download: Save as .txt file for import into deck builders
  • Platform Compatible: Works with MTG Arena, MTGO, TappedOut, Archidekt, and more

How to Use

  1. Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Review Output: The Magic deck list generates automatically
  3. Copy or Download: Use the Copy or Download button to save your deck list
  4. Import to Platform: Import the deck list into your favorite MTG platform

Expected MySQL Format

The converter expects MySQL data with at least 2 columns:

  • Column 1: Quantity (number of cards)
  • Column 2: Card name
  • Additional columns: Ignored (can contain card type, mana cost, etc.)

Example Conversion

MySQL Input:

CREATE TABLE deck (
  quantity INT,
  card_name VARCHAR(100),
  card_type VARCHAR(50)
);

INSERT INTO deck VALUES (4, 'Lightning Bolt', 'Instant');
INSERT INTO deck VALUES (4, 'Counterspell', 'Instant');
INSERT INTO deck VALUES (3, 'Tarmogoyf', 'Creature');
INSERT INTO deck VALUES (20, 'Island', 'Basic Land');

Magic Deck Output:

// Magic: The Gathering Deck Format
// Format: Quantity CardName

4 Lightning Bolt
4 Counterspell
3 Tarmogoyf
20 Island

Common Use Cases

  • Collection Management: Export card collections from MySQL to deck builder platforms
  • Deck Lists: Convert stored deck lists to standard MTG format
  • Tournament Submissions: Generate deck lists for tournament registration
  • Inventory Systems: Export card inventory from database to trading platforms
  • Deck Analysis: Import database deck data into analysis tools
  • Backup & Migration: Convert MySQL deck data for backup or platform migration

Compatible Platforms

The generated deck list format is compatible with:

  • MTG Arena: Import decks directly into the game client
  • Magic Online (MTGO): Standard deck list format
  • TappedOut: Deck building and sharing platform
  • Archidekt: Visual deck builder
  • Moxfield: Modern deck building platform
  • Scryfall: Card search and deck building
  • EDHRec: Commander deck recommendations

Deck Format Specifications

The standard Magic deck format follows these rules:

  • Format: Each line contains "Quantity CardName"
  • Quantity: Number of copies (1-4 for most cards, unlimited for basic lands)
  • Card Name: Exact card name as printed (case-sensitive on some platforms)
  • Comments: Lines starting with // are treated as comments
  • Sections: Some platforms support sections like "Mainboard" and "Sideboard"

Tips for Best Results

  • Exact Names: Ensure card names match official Gatherer database spellings
  • Quantity Limits: Verify quantities comply with format rules (max 4 for non-basic cards)
  • Set Codes: Some platforms support set codes like "4 Lightning Bolt (LEA)"
  • Sideboard: Add a comment line "// Sideboard" to separate sideboard cards
  • Commander: Add "1 Commander Name" at the top for Commander format

Privacy & Security

All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.