MySQL to AsciiDoc Converter

Transform MySQL database dumps into AsciiDoc table format for technical documentation and publishing

About MySQL to AsciiDoc Converter

Convert MySQL database dumps (CREATE TABLE and INSERT statements) to AsciiDoc table markup. Perfect for technical documentation, books, and publishing workflows using AsciiDoc/Asciidoctor.

Key Features

  • Multiple Table Styles: Default, Grid (all borders), or Custom column widths
  • Smart Parsing: Extracts table structure and data from CREATE TABLE and INSERT statements
  • Header Support: Toggle header row with AsciiDoc options
  • Column Width Control: Automatic column width calculation for optimal display
  • AsciiDoc Compliant: Generates valid AsciiDoc table syntax
  • File Upload: Upload .sql files directly
  • Instant Preview: Real-time conversion as you type
  • Copy & Download: Easy export as .adoc file

How to Use

  1. Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Choose Style: Select your preferred table style and header options
  3. Review Output: The AsciiDoc markup updates automatically
  4. Copy or Download: Use the Copy or Download button to save your AsciiDoc

Table Styles

Default Style:

[options="header"]
|===
|id |name |age |city

|1 |John Doe |28 |New York
|2 |Jane Smith |34 |London
|===

Grid Style (all borders):

[options="header",frame="all",grid="all"]
|===
|id |name |age |city

|1 |John Doe |28 |New York
|2 |Jane Smith |34 |London
|===

Custom Column Widths:

[options="header",cols="1,2,1,2"]
|===
|id |name |age |city

|1 |John Doe |28 |New York
|2 |Jane Smith |34 |London
|===

Supported MySQL Syntax

  • CREATE TABLE: Extracts column names and structure
  • INSERT INTO: Parses data values from INSERT statements
  • Data Types: Handles VARCHAR, INT, DECIMAL, TEXT, DATE, etc.
  • NULL Values: Converts SQL NULL to empty cells
  • Quoted Strings: Handles single and double quotes

Common Use Cases

  • Technical Documentation: Include database tables in AsciiDoc documentation
  • Books & eBooks: Use in O'Reilly, Manning, and other technical books
  • API Documentation: Document database schemas in API docs
  • README Files: Add formatted tables to project documentation
  • Asciidoctor: Generate content for Asciidoctor processing
  • GitHub/GitLab: Use in .adoc files for repository documentation
  • Confluence: Some Confluence instances support AsciiDoc

AsciiDoc Table Features

  • Header Row: Automatic header formatting with options="header"
  • Borders: Control frame and grid with attributes
  • Column Widths: Proportional column sizing with cols attribute
  • Cell Alignment: Can be extended with alignment markers
  • Cell Formatting: Supports AsciiDoc formatting within cells

Integration with AsciiDoc Tools

The generated AsciiDoc markup works with:

  • Asciidoctor: Ruby-based AsciiDoc processor
  • Asciidoctor.js: JavaScript implementation
  • AsciidocFX: AsciiDoc editor and toolchain
  • GitHub: Native .adoc file rendering
  • GitLab: Built-in AsciiDoc support
  • Hugo: Static site generator with AsciiDoc support

Tips for Best Results

  • Include both CREATE TABLE and INSERT statements for best column name detection
  • Use Default style for simple, clean tables
  • Use Grid style when you need visible cell borders
  • Use Custom Column Widths for better control over table layout
  • Enable header row for better readability
  • Test the output in your AsciiDoc processor (Asciidoctor, etc.)
  • Combine with other AsciiDoc features like captions and titles

FAQ

  • Can I add a table title or caption?

    Yes. After copying the generated AsciiDoc, you can add a title line like .Employee Data directly above the [options="header"] block.

  • Does this work with Asciidoctor PDF and HTML outputs?

    Yes. The generated table markup is standard AsciiDoc and works with Asciidoctor HTML, PDF, and other backends.

  • Do I have to include CREATE TABLE?

    No. If CREATE TABLE is missing, the tool will infer or generate generic column names, but including it produces better headers.

  • How are NULL values represented?

    NULLs are converted to empty cells in the AsciiDoc table so they render as blank fields.

  • Is any processing done on a backend server?

    No. All parsing and conversion happen in your browser, so your SQL never leaves your device.

Privacy & Security

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