SQL to Markdown Converter

Transform SQL database dumps into GitHub Flavored Markdown (GFM) tables with automatic alignment detection and flexible formatting options

SQL Input

Markdown Output

About SQL to Markdown Converter

Convert SQL database dumps (CREATE TABLE and INSERT statements) to GitHub Flavored Markdown (GFM) tables. Perfect for documentation, README files, GitHub wikis, and any Markdown-based content that needs to display tabular data.

Key Features

  • GitHub Flavored Markdown: Full GFM table syntax support
  • Auto-Alignment: Automatically detects numeric columns for right alignment
  • Multiple Styles: GitHub style (with edge pipes) or simple style
  • Column Alignment: Left, center, right, or auto-detect alignment
  • Special Character Escaping: Handles pipes and special characters
  • Smart Parsing: Extracts column names and data from SQL dumps
  • File Download: Save as .md file

How to Use

  1. Input SQL Data: Paste your SQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Choose Style: Select GitHub or simple table style
  3. Set Alignment: Choose auto-detect or manual alignment
  4. Configure Header: Toggle header row inclusion
  5. Copy or Download: Use the Copy or Download button to save your Markdown

Table Styles

GitHub Style (with edge pipes):

  • Standard GitHub Flavored Markdown format
  • Pipes at the beginning and end of each row
  • Most widely supported format
  • Works on GitHub, GitLab, Bitbucket, etc.

Simple Style (no edge pipes):

  • Cleaner, more minimal syntax
  • No pipes at row edges
  • Supported by many Markdown parsers
  • More readable in plain text

Example Conversion

SQL Input:

CREATE TABLE products (
  id INT,
  name VARCHAR(100),
  price DECIMAL(10,2),
  category VARCHAR(50)
);

INSERT INTO products VALUES (1, 'Laptop', 999.99, 'Electronics');
INSERT INTO products VALUES (2, 'Mouse', 24.99, 'Accessories');
INSERT INTO products VALUES (3, 'Keyboard', 79.99, 'Accessories');

Markdown Output (GitHub style, auto-align):

| id | name | price | category |
| :-- | :-- | --: | :-- |
| 1 | Laptop | 999.99 | Electronics |
| 2 | Mouse | 24.99 | Accessories |
| 3 | Keyboard | 79.99 | Accessories |

Rendered Table:

idnamepricecategory
1Laptop999.99Electronics
2Mouse24.99Accessories
3Keyboard79.99Accessories

Alignment Options

  • Auto-detect: Numbers are right-aligned, text is left-aligned
  • Left (:--) All columns left-aligned
  • Center (:-:) All columns center-aligned
  • Right (--:) All columns right-aligned

Common Use Cases

  • GitHub README: Display database schemas and sample data
  • Documentation: Include data tables in technical documentation
  • Wiki Pages: Create tables for GitHub, GitLab, or Bitbucket wikis
  • Blog Posts: Add data tables to Markdown-based blogs (Jekyll, Hugo, etc.)
  • Issue Tracking: Include tables in GitHub/GitLab issues
  • Pull Requests: Document changes with data tables

Platform Compatibility

The generated Markdown tables work on:

  • GitHub: README, wikis, issues, pull requests, discussions
  • GitLab: README, wikis, merge requests, issues
  • Bitbucket: README, wikis, pull requests
  • Static Site Generators: Jekyll, Hugo, Gatsby, Next.js
  • Documentation Tools: MkDocs, Docusaurus, VuePress
  • Note-Taking Apps: Obsidian, Notion, Typora

Auto-Alignment Detection

When auto-alignment is enabled, the converter:

  • Analyzes each column's data
  • Right-aligns columns with only numeric values
  • Left-aligns columns with text or mixed content
  • Provides optimal readability for different data types

Special Character Handling

The converter automatically escapes:

  • Pipe character (|): Escaped as \| to prevent breaking table structure
  • Newlines: Converted to spaces for single-line cells
  • Carriage returns: Removed for clean output

Privacy & Security

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