FormatterHQ

SQL to HTML Table Converter

See the rows inside CREATE TABLE and INSERT statements as a readable table, and copy the HTML for documentation, wikis or reports. Nothing is sent to a database.

Input SQL
Output HTML
Ready.

How to use the SQL to HTML Table Converter

  1. Paste INSERT INTO statements (with or without CREATE TABLE), upload a .sql file, or click Sample.
  2. Choose a Layout: Auto, Single flat table or Nested tables.
  3. Pick a Styling option: No CSS, Bordered or Striped rows.
  4. Click Convert to HTML and switch to the Preview tab to read the table.
  5. Copy the markup, or download it; downloading from the Preview tab saves a complete page with the styling.

SQL to HTML: read and share INSERT data as a table

A long INSERT INTO … VALUES statement is hard to read. Values run together on one line, and you have to count commas to know which column a value belongs to. This sql to html converter parses the statements and lays the rows out as an HTML table with the column names as headings, so you can inspect a dump, review a seed file, or paste the data into documentation.

The Preview tab shows the rendered table immediately. The Code tab holds clean table markup you can place in a wiki page, an internal report, a README rendered as HTML, or an email.

Example

INSERT INTO plans (code, name, monthly, active) VALUES
  ('S', 'Starter', 9, 1),
  ('P', 'Pro <beta>', 29, 0);

With Layout Auto and Styling No CSS the output is:

<table>
  <thead>
    <tr>
      <th>code</th>
      <th>name</th>
      <th>monthly</th>
      <th>active</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>S</td>
      <td>Starter</td>
      <td>9</td>
      <td>1</td>
    </tr>
    <tr>
      <td>P</td>
      <td>Pro &lt;beta&gt;</td>
      <td>29</td>
      <td>0</td>
    </tr>
  </tbody>
</table>

Values are HTML-escaped, so text such as Pro <beta> appears literally instead of being interpreted as a tag. That matters when you preview data from an unknown source: markup or script fragments stored in the database cannot run in your page.

Layout options

  • Auto – one table for a single database table. When the SQL inserts into several tables, it builds an outer table with one row per database table: the table name as a heading cell and its rows as a nested table beside it. That gives a quick overview of a whole seed file.
  • Single flat table – forces one table. Use it only with a single table; several tables would be squeezed into one very wide row.
  • Nested tables – for a single table, produces compact markup with each row on one line, useful when the size of the snippet matters.

Styling options

No CSS returns the bare table so it inherits your site or wiki styles. Bordered prepends a <style> block with collapsed borders, cell padding, a blue header row and a hover highlight. Striped rows adds alternating light gray rows on top of that. Because the style rules target all table, th and td elements, use them for standalone pages or previews, and No CSS when pasting into a page that already has table styles.

How values appear

  • NULL is shown as an empty cell.
  • Numbers appear in their shortest form: 250.00 is shown as 250.
  • Booleans written as TRUE/FALSE show as true/false; MySQL flags stored as 1/0 stay numbers.
  • Expressions such as NOW() are shown as written, since nothing is executed.
  • Column names come from the INSERT column list, then from a matching CREATE TABLE, and otherwise are numbered column1, column2 and so on.

Where this fits

To review data from a large dump, paste only the statements for the tables you care about; everything is rendered in the browser, and very long tables are easier to read in pieces. When the goal is a spreadsheet rather than a web page, SQL to CSV is the better target. For tables you want to write or edit by hand, try the HTML table generator, and to make the SQL itself readable, run it through the SQL formatter.

Privacy

The SQL is parsed and rendered in your browser, and the preview is shown in a sandboxed frame. Nothing is uploaded unless you use Load URL or Save & Share.

Frequently asked questions

Can I view a whole mysqldump file as tables?
Yes. With Layout set to Auto, each table in the dump gets its own nested table under its name. For very large dumps, paste one table at a time to keep the page responsive.
Does it run my SQL?
No. The statements are parsed as text and nothing is executed. That is why SELECT queries produce no table: they contain no row data.
Why does a NULL column look empty?
HTML has no null value, so NULL is rendered as an empty cell, just like an empty string. Convert to JSON if you need to distinguish the two.
How do I get a complete HTML page instead of just the table?
Switch to the Preview tab and click Download. That saves a full page including the chosen styling, which you can open in any browser.
Is HTML inside my data rendered?
No. Values are escaped, so tags stored in the database appear as text. This keeps the preview safe when the data comes from an untrusted source.

Last updated October 3, 2026

Related tools