SQL to HTML
Render SQL INSERT data as HTML tables.
SQL to HTML Table Converter Online
The SQL to HTML converter renders the rows of INSERT statements as HTML tables. Paste a SQL dump and you get copy-ready <table> markup plus a live preview of how it looks in a browser. It is a handy way to share database content in documentation, a status page, an internal wiki, or an email without exporting through a spreadsheet first.
What you get
For every table that receives data, the converter writes a <table> with a <thead> row of column names and a <tbody> containing one <tr> per inserted row. The optional <caption> shows the table name, which is especially helpful when a dump contains several related tables such as customers, orders, and order items.
Options
- Borders – adds
border="1", cell padding, and cell spacing so the table is readable without CSS. Switch it off for bare, stylable markup. - Table name as caption – label each table with the database table it came from.
How rows are read
Column names come from the INSERT column list, or from a matching CREATE TABLE when a statement lists only values. Multiple INSERT statements into the same table are merged into one HTML table. Quoted strings are unescaped ('O''Brien' shows as O'Brien), and NULL becomes an empty cell. Everything else in the script — comments, DROP TABLE, transaction statements — is ignored.
Use cases
Paste a small lookup table into a Confluence or Notion page, include a reference data sample in a pull request description, or quickly eyeball a backup without restoring it. For interactive filtering and sorting, the SQL Viewer shows the same data as a searchable grid.
Related tools
Convert the data to CSV, JSON, or YAML. Spreadsheet users can do the same with Excel to HTML or CSV to HTML, and HTML to CSV reverses the process.
Frequently Asked Questions
What if the SQL fills several tables?
You get one HTML table per database table, separated by a blank line, in the order the tables first appear in the script. With captions on, each table is labelled with its database table name.
How are NULL values displayed?
NULL columns are rendered as empty cells so the table stays clean. Numbers are shown as plain values without SQL formatting.
Can I style the table with my own CSS?
Yes. Turn off Borders to get markup without the border, cellpadding, and cellspacing attributes, then style the <table>, <th>, and <td> elements from your stylesheet.
Is the data escaped?
Yes. Values are HTML-escaped, so strings that contain tags or ampersands are shown as text and cannot inject markup into your page.