Convert HTML table to SQL

Form for HTML converting to SQL

This form allows you convert HTML tables to SQL queries, paste or upload your HTML file below:


Your result can be seen below.

Result of HTML conversion to SQL


Move to "Paste Code" for Save it

About HTML conversion to SQL

About HTML tables conversion to SQL queries

The HTML to SQL Converter was created for online transform HTML tables into SQL(Structured Query Language) queries to insert in the database. This awesome tool supports custom table name and several MySQL commands to insert. It's very simple and easy way to transform and share HTML to SQL queries.

As a result, you will receive several queries:

  • SQL query to create a table. But this is just an example of "create table"; in fact, it is not recommended to execute this query, because it does not contain indexes, keys, valid types, etc.
  • Insert or Replace queries.

How it Works?

Just select the options you need and paste your HTML tables to the textarea above and click to the button "Convert" and you will instantly get SQL queries.

Example of HTML conversion to SQL

Before:
<!DOCTYPE html>
<html>
<head>
<style>h1{color:orange;text-align:center;}</style>
</head>
<body>
<h1>HTML example!</h1>
<p>This is a paragraph.</p>
<table>
<thead>
<tr>
<td>id</td>
<td>firstName</td>
<td>lastName</td>
<td>age</td>
</tr>
</thead>
<tr>
<td>1</td>
<td>Kim</td>
<td>Kardashian</td>
<td>39</td>
</tr>
<tr>
<td>2</td>
<td>Ariana</td>
<td>Grande</td>
<td>26</td>
</tr>
<tr>
<td>3</td>
<td>Cristiano</td>
<td>Ronaldo</td>
<td>35</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</body>
</html>
After:
/* CREATE TABLE */
CREATE TABLE table_name(
`id` DOUBLE,
`firstName` VARCHAR(100),
`lastName` VARCHAR(100),
`age` DOUBLE
);

/* INSERT QUERY NO: 1 */
INSERT INTO table_name(`id`, `firstName`, `lastName`, `age`)
VALUES (1, 'Kim', 'Kardashian', 39);

/* INSERT QUERY NO: 2 */
INSERT INTO table_name(`id`, `firstName`, `lastName`, `age`)
VALUES (2, 'Ariana', 'Grande', 26);

/* INSERT QUERY NO: 3 */
INSERT INTO table_name(`id`, `firstName`, `lastName`, `age`)
VALUES (3, 'Cristiano', 'Ronaldo', 35);

After conversion, you can execute these commands in your SQL server and add all data to your database.