Markdown To SQL

Login

Email
Password

Don't have an account yet?

Go to Sign up

Input Data
Sample {{ showCoderInput ? 'Choose File' : 'Enter Data' }}

                                
Valid Data Invalid Data — Cannot parse as table
Online Table Editor
Row Col Row Col
Transpose Clear Delete Empty Deduplicate
ABC abc Abc
Replace
First Row as Header
{{ displayRows.length }} rows x {{ displayHeaders.length }} columns{{ firstRowAsHeader ? ' (1 header)' : '' }} {{ selectedRows.length > 0 ? selectedRows.length + ' selected' : '' }}
Output Data ({{ sqlFormatDisplayName }})
{{ copied ? 'Copied!' : 'Copy to Clipboard' }} Download File
Properties
Convert table data online — paste, edit, and download.

Create Table
Batch Insert
Drop Table (If Exists)
Database Type:
Table Name:
Primary Key:
Convert Restart
Insert Row Below
Insert Row Above
Insert Column Right
Insert Column Left
Delete Row {{ contextMenu.row + 1 }}
Delete Column {{ contextMenu.col + 1 }}
Clear Cell
Clear Row
Case sensitive Use regex Cancel Replace All

What Is the Markdown To SQL Converter?

The Markdown To SQL Converter on A.Tools transforms Markdown pipe-delimited tables into SQL CREATE TABLE and INSERT INTO statements for MySQL, PostgreSQL, SQLite, and SQL Server. All processing runs in your browser. No data leaves your device.

Developers document data structures in Markdown tables within README files and wikis. Databases require SQL statements to create and populate tables. This tool bridges the two without manual SQL writing.

How to Convert Markdown Tables to SQL?

Step 1: Provide Your Markdown Data

Click Enter Data to paste a Markdown table into the input area, or click Choose File to drag and drop a .md file. Press Sample to load example data.

Step 2: Edit in the Online Table Editor

Once parsed, an interactive spreadsheet appears. Use the toolbar to:

  • Add or delete rows and columns

  • Transpose the table (swap rows and columns)

  • Remove duplicate rows

  • Delete empty rows and columns

  • Change text case (UPPERCASE, lowercase, Capitalize)

  • Find and replace values — supports case-sensitive search and regex

  • Toggle First Row as Header to define column names

Right-click any cell for context-menu operations.

Step 3: Configure SQL Output

In the Properties panel:

SettingOptionsDescription
Create TableOn / OffGenerates a CREATE TABLE statement
Batch InsertOn / OffCombines all rows into a single INSERT statement
Drop Table (If Exists)On / OffAdds DROP TABLE IF EXISTS before CREATE TABLE
Database TypeMySQL / PostgreSQL / SQLite / SQL ServerSets the SQL dialect
Table NameCustom nameThe name used in CREATE TABLE and INSERT INTO
Primary KeyColumn name (optional)Marks a column as PRIMARY KEY

Step 4: Export

Click Convert to generate SQL output. Use Copy to Clipboard or Download File to save.

Key Features

  • Two input modes: Paste Markdown directly or upload a .md file

  • Full table editor: Edit, transpose, deduplicate, find-and-replace before converting

  • 4 database dialects: MySQL, PostgreSQL, SQLite, SQL Server

  • CREATE TABLE generation: Column names from header row, type inference

  • INSERT generation: Individual or batch mode

  • Primary key support: Designate any column as the primary key

  • DROP TABLE option: Idempotent script generation

  • Client-side processing: Files never leave the browser

  • Undo/Redo: Full edit history with revert support

  • Context menu: Right-click for quick row/column/cell operations

What SQL Statements Are Generated?

Given this Markdown input:

| id | name  | age |
|----|-------|-----|
| 1  | Alice | 30  |
| 2  | Bob   | 25  |

With Create Table and Batch Insert enabled, the tool generates:

DROP TABLE IF EXISTS `users`;

CREATE
TABLE `users` (
 `id` TEXT,
 `name` TEXT,
 `age` TEXT,
 PRIMARY KEY (`id`)
);

INSERT
INTO `users` (`id`, `name`, `age`) VALUES
 ('1', 'Alice', '30'),
 ('2', 'Bob', '25');

With Batch Insert disabled, each row gets its own INSERT:

INSERT INTO `users` (`id`, `name`, `age`) VALUES ('1', 'Alice', '30');
INSERT INTO `users` (`id`, `name`, `age`) VALUES ('2', 'Bob', '25');

CREATE TABLE

Generated when the toggle is on. Column names come from the first row (header). Column types default to TEXT unless type inference detects integers or floats.

INSERT INTO

Generated for every data row. String values are wrapped in single quotes. NULL values are preserved.

DROP TABLE IF EXISTS

Generated when the toggle is on. Placed before CREATE TABLE to enable idempotent script execution.

Supported Database Dialects

The tool generates dialect-specific SQL syntax:

FeatureMySQLPostgreSQLSQLiteSQL Server
Identifier quoting`name`"name""name"[name]
String quoting'value''value''value''value'
DROP IF EXISTSDROP TABLE IF EXISTSDROP TABLE IF EXISTSDROP TABLE IF EXISTSIF OBJECT_ID(...) IS NOT NULL DROP TABLE
AUTO_INCREMENTAUTO_INCREMENTSERIALAUTOINCREMENTIDENTITY(1,1)
Batch INSERTVALUES (), (), ()VALUES (), (), ()VALUES (), (), ()INSERT ... SELECT UNION ALL
Primary KeyInline or constraintInline or constraintInline or constraintInline or constraint

Documentation links:

SQL Output Settings Explained

Create Table

When enabled, generates a CREATE TABLE statement with columns derived from the header row. Column types default to TEXT. The tool performs basic type inference: if every value in a column is numeric, the type is set to INTEGER or FLOAT.

Disable this option when you only need INSERT statements for an existing table.

Batch Insert

When enabled, all data rows are combined into a single INSERT INTO ... VALUES (), (), () statement. This is faster to execute than individual inserts.

When disabled, each row generates its own INSERT INTO statement. Easier to debug and modify individual rows.

Drop Table (If Exists)

Adds DROP TABLE IF EXISTS before CREATE TABLE. Use this when generating idempotent scripts that can be re-run without errors.

Do not enable if the target database already contains data you want to preserve.

Database Type

Controls the SQL dialect for:

  • Identifier quoting (backticks, double quotes, square brackets)

  • DROP TABLE syntax

  • Auto-increment column types

  • Batch insert syntax

Table Name

Sets the table name used in CREATE TABLE and INSERT INTO statements. Use lowercase with underscores for convention (e.g., user_accounts).

Primary Key

Enter a column name to mark it as PRIMARY KEY. The column must exist in the header row. This adds a PRIMARY KEY (column_name) constraint to the CREATE TABLE statement.

Markdown Tables vs. SQL: When to Convert

ScenarioUse MarkdownUse SQLConvert
README documentationYesNo
Database schema migrationNoYesMarkdown → SQL
Seeding a databaseNoYesMarkdown → SQL
Quick prototypingBothBothAs needed
Data in version control (Git)YesYesMarkdown → SQL
Test fixture generationNoYesMarkdown → SQL
API documentationYesNo

Markdown tables are for human-readable documentation. SQL is for machine-executable database operations. This converter eliminates manual translation when tabular data needs to become database records.

Frequently Asked Questions (FAQ)

  • Does this tool upload my files to a server?

    No. All file parsing and conversion runs in your browser using JavaScript. Your data stays on your device. A.Tools never receives, stores, or transmits your file contents.

  • What Markdown table formats are supported?

    The tool supports standard pipe-delimited Markdown tables following the CommonMark specification, including tables with or without leading/trailing pipes and alignment indicators.

  • Which SQL databases are supported?

    MySQL, PostgreSQL, SQLite, and Microsoft SQL Server. The Database Type dropdown in the Properties panel switches between dialect-specific syntax for identifier quoting, DROP TABLE, and batch INSERT.

  • What is the difference between batch insert and individual inserts?

    Batch insert combines all rows into a single INSERT INTO ... VALUES (), (), () statement, which executes faster. Individual inserts generate one INSERT INTO per row, which is easier to debug and edit.

  • Does the tool perform SQL type inference?

    Yes. By default, all columns are typed as TEXT. If every value in a column is a valid integer, the type is set to INTEGER. If every value is a valid number with a decimal point, the type is set to FLOAT.

  • Can I specify a primary key?

    Yes. Enter the column name in the Primary Key field. The column must match one of your header row values. The tool adds a PRIMARY KEY (column_name) constraint to the CREATE TABLE statement.

  • What does "Drop Table (If Exists)" do?

    It adds DROP TABLE IF EXISTS table_name before the CREATE TABLE statement. This makes the generated script idempotent — safe to re-run without errors. Do not enable if the table already contains data you want to keep.

  • Is there a file size limit?

    Processing is client-side, so the limit depends on your browser's memory. Tables with tens of thousands of rows work reliably on modern browsers.

Featured Tools

Featured tools that you might find useful.

Popular Tools

List of popular tools that users love and frequently use.

New Tools

The latest tools added to our collection, designed for you.

Topics

The tools grouped by topics to quickly find what you need.
Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.

Excel To JSON

Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.
Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.

Excel To CSV

Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.
Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.

Excel To SQL

Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.
Free online Excel to ASCII table converter with 10 border styles (MySQL, Unicode, reStructuredText, and more). Add code comment wrappers in 8 languages. Supports text alignment. Client-side processing.

Excel To ASCII Table

Free online Excel to ASCII table converter with 10 border styles (MySQL, Unicode, reStructuredText, and more). Add code comment wrappers in 8 languages. Supports text alignment. Client-side processing.