MediaWiki to TOML Converter

Transform MediaWiki tables into TOML configuration format with automatic type detection and flexible output styles

MediaWiki Input

TOML Output

About MediaWiki to TOML Converter

Convert MediaWiki table markup to TOML (Tom's Obvious, Minimal Language) configuration format. TOML is a minimal configuration file format that's easy to read and write, commonly used in Rust, Python, and other modern applications.

Key Features

  • Array of Tables: Generate readable [[table]] format for structured data
  • Inline Arrays: Compact array format for simple data
  • Type Detection: Automatically detect integer, float, boolean, and string types
  • Key Sanitization: Convert headers to valid TOML keys
  • String Escaping: Proper escaping of special characters
  • Custom Array Name: Specify your own array/table name
  • MediaWiki Parser: Accurately parses MediaWiki table syntax
  • File Upload: Upload .wiki files directly
  • Instant Preview: Real-time conversion as you type
  • Copy & Download: Easy export as .toml file

How to Use

  1. Input MediaWiki Table: Paste your MediaWiki table markup or upload a .wiki file
  2. Configure Array Name: Set the desired array/table name
  3. Choose Format: Select array of tables or inline arrays
  4. Toggle Type Detection: Enable/disable automatic type detection
  5. Review Output: The TOML output updates automatically
  6. Export: Copy to clipboard or download as .toml file

TOML Formats

  • Array of Tables: [[data]] format - more readable, better for complex data
  • Inline Arrays: data = [[...], [...]] format - compact, good for simple data

Example Conversion

MediaWiki Input:

{| class="wikitable" border="1"
! Name !! Age !! City !! Active
|-
| John Doe || 28 || New York || true
|-
| Jane Smith || 34 || London || false
|}

TOML Output (Array of Tables):

# TOML Array of Tables

[[data]]
Name = "John Doe"
Age = 28
City = "New York"
Active = true

[[data]]
Name = "Jane Smith"
Age = 34
City = "London"
Active = false

TOML Output (Inline Arrays):

# TOML Array of Arrays
data = [
  ["Name", "Age", "City", "Active"],
  ["John Doe", 28, "New York", true],
  ["Jane Smith", 34, "London", false]
]

Common Use Cases

  • Configuration Files: Create config files for Rust, Python, Go applications
  • Cargo.toml: Generate dependencies or metadata for Rust projects
  • pyproject.toml: Create Python project configuration
  • Hugo Config: Configure Hugo static site generator
  • Data Serialization: Store structured data in human-readable format
  • Settings Management: Application settings and preferences
  • Test Data: Generate test fixtures in TOML format

TOML Compatibility

This converter generates TOML v1.0.0 compliant output that works with:

  • Rust (Cargo, serde_toml)
  • Python (toml, tomli, tomllib)
  • Go (BurntSushi/toml)
  • Hugo static site generator
  • Any TOML v1.0.0 compliant parser

MediaWiki Table Syntax

Supports standard MediaWiki table markup:

  • {|: Table opening with optional attributes
  • ! Header: Exclamation mark for header cells (separated by !!)
  • |-: Row separator
  • | Data: Pipe for data cells (separated by ||)
  • |}: Table closing

Type Detection

When auto-detect is enabled, the converter recognizes:

  • Integer: Whole numbers (e.g., 42, -10)
  • Float: Decimal numbers (e.g., 3.14, -0.5)
  • Boolean: true or false (case-insensitive)
  • String: Any other text (quoted in TOML)

Key Sanitization

Column headers are converted to valid TOML keys:

  • Special characters replaced with underscores
  • Keys starting with numbers prefixed with underscore
  • Quoted keys used when necessary
  • Preserves readability while ensuring TOML compliance

Tips for Best Results

  • Use array of tables for complex, structured data
  • Use inline arrays for simple, homogeneous data
  • Enable type detection for accurate data representation
  • Use descriptive array names that match your use case
  • Validate output with a TOML parser before use
  • Keep column names simple for cleaner TOML keys

Privacy & Security

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