SQL to HTML Converter

Paste INSERT statements from a seed file, a migration or a client export. Each table becomes an HTML block with column headers taken from the statement and every cell value escaped before you copy or download.

SQL to HTML conversion workspace

  • Escaped cell output
  • One block per table
  • Runs in your tab
Output
Table look
SQL input.sql
HTML outputWaiting for SQL
0Tables found
0Rows parsed
0Columns
FullOutput mode

Nobody reads a dump in a README

An INSERT line already carries a miniature spreadsheet: table name, column list, one tuple per row. Turning those tuples into an HTML table is the fastest way to make seed data legible in internal docs, a pull request description or a support ticket. The hard part is not the tags. The hard part is keeping commas inside quoted strings from splitting a row in half, then writing every cell value back out without letting a stray angle bracket break the page.

Limitation up front: only INSERT and REPLACE statements with literal value tuples are read. A SELECT export, an INSERT ... SELECT, or a CREATE TABLE block is skipped entirely. If your file is mostly DDL, run the SQL formatter first so you see what is left, then paste the INSERT sections here.

How a statement maps to markup

The parser walks the text character by character inside the VALUES section, the same approach the SQL to CSV converter uses. Quoted strings, nested parentheses inside a function call, and doubled apostrophes all stay inside one field. Once the tuples are split, the mapping is mechanical.

Part of the INSERTBecomes in HTML
Table name after INTOA heading above each <table>, or a data-table attribute on the wrapper
Column list in parentheses<th> cells inside <thead>
Each value tupleOne <tr> in <tbody>
NULLAn empty <td>
Text with <, & or quotesEscaped entities so the browser prints the character instead of parsing it
SQL in
INSERT INTO products (sku, label, price) VALUES
('KB-88', 'Mech keyboard', 189.00),('MS-12', '27" mouse pad', NULL);
HTML out (bare)
<table><thead><tr><th>sku</th><th>label</th><th>price</th></tr></thead><tbody><tr><td>KB-88</td><td>Mech keyboard</td><td>189.00</td></tr><tr><td>MS-12</td><td>27" mouse pad</td><td></td></tr></tbody></table>

Row two needed two rewrites. The inch mark became &quot; inside the cell. The NULL became an empty cell instead of the four letters NULL, because HTML has no native missing value and an empty cell reads cleaner in a doc than a misleading word.

Full page versus a fragment you paste elsewhere

Two output modes sit above the editors, and they target different destinations.

The Styled preset adds borders, zebra rows and a coloured table title bar. Bare markup emits plain <table> tags with no class names and no CSS, which is what you want when your site already ships a table component and you only need the rows.

Several tables in one paste

Real dumps interleave users, orders and line items. Each distinct table name becomes its own HTML block. The picker at the top right switches the preview to one table while Include every table stays checked, which is what copy and download use. Turn the checkbox off to export only the table you are previewing, handy when a ten-table dump needs one grid in a ticket.

Rows are grouped by table name, not by file position, so a dump that returns to the users table halfway down still lands in one block. Schema prefixes such as public.orders are kept in the name so two schemas with an orders table do not merge.

Escaping is not optional

Seed data often contains user-supplied text. A product description with <script> in it is still data, but an unescaped cell would run as markup in a browser. Every value is passed through an HTML entity encoder before output. Apostrophes, ampersands and angle brackets become entities. The page you generate is safe to open locally.

That encoding is one-directional. Pasting the HTML into a Markdown file that allows raw HTML still executes nothing as long as the host respects standard escaping. Pasting into a WYSIWYG editor that re-interprets entities is outside what this tool controls.

When CSV or XML fits better

HTML tables are for human eyes in a browser or a doc system. They are a poor interchange format.

What never becomes a row

Nothing you paste is uploaded. Conversion, preview, copy and download all run in JavaScript on this page, so a dump with customer rows never leaves your machine.

Questions about converting SQL to HTML

Output modes, escaping, multiple tables, dialect support and what the parser skips.

What is the difference between Full page and Fragment only?

Full page wraps your tables in a complete HTML document with a doctype, head, charset meta tag, viewport line and a small embedded stylesheet so you can open the download in a browser immediately. Fragment only outputs the table blocks themselves, which is what you paste into a CMS, a wiki or a static site template that already owns the outer page. Copy and download always respect whichever mode is selected.

Why are my cell values full of &amp;lt; and &amp;quot; entities?

That is deliberate escaping. User-supplied text often contains angle brackets, ampersands or quotes. Writing those characters raw into a td would change the DOM or run script in a browser. The encoder turns them into entities so the page displays the characters literally. Switch to Bare markup if you need unstyled tags without the coloured title bar, but escaping still applies in both style presets.

My dump has eight tables. Do I get eight files?

You get one file or one clipboard copy containing every table as a separate block, unless you uncheck Include every table, in which case only the table selected in the picker is exported. The picker still controls the preview in the right panel so you can inspect one grid at a time. Each block is headed by the table name so you can split them apart manually if needed.

Does it read Postgres or SQL Server dumps, not only MySQL?

Yes, as far as INSERT syntax goes. Backtick, double-quote and square-bracket identifiers are stripped from table and column names. Schema prefixes such as dbo.Orders or public.users are preserved in the table name. INSERT IGNORE, INSERT OR REPLACE and REPLACE INTO are treated as ordinary inserts. A Postgres COPY block is not an INSERT, so it is skipped.

An INSERT has no column list. What are the headers?

The statement carries no names, so the header row reads column_1 through column_n based on the value count in the first tuple. A note appears under the editors telling you the names were generated. Add the column list to the INSERT in the left panel and convert again, or edit the th line in the output before copying.

Can I paste the HTML into GitHub Markdown?

GitHub strips most raw HTML in Markdown comments, so a table often disappears or renders as plain text. For a README, a CSV pasted into a Markdown table by hand, or a link to the downloaded HTML file, tends to work better. Fragment mode plus Bare markup is still useful inside static site generators and doc platforms that allow HTML blocks.

Why does NOW() show up as text in a cell?

The converter never talks to a database. NOW(), UUID() and similar function calls are stored as the characters you typed, not as evaluated results. If you need the timestamp a row was inserted, run the dump on the server or replace the function with a literal before converting.

Is my SQL sent to a server?

No. Parsing, HTML generation, preview, copy and download all happen in your browser after the page loads. No request carries your input, nothing is stored between visits, and closing the tab clears both panels.