GGfor Tools

HTML Table Cleaner

Clean up messy table code by stripping inline styles, removing empty rows, trimming cells, and optionally converting to Markdown.

Clean HTML tables or convert table text

Choose HTML, CSV or TSV input. HTML output preserves supported structure; Markdown extracts cell text. The first-row header option applies to delimited input and Markdown only.

Waiting for input...

HTML table cleaner: preserve structure or export Markdown

Clean pasted HTML tables for editing, or turn CSV and TSV records into HTML or Markdown tables. HTML output keeps supported table structure and inline formatting. Markdown output extracts readable cell text. Choose the output for your destination rather than assuming that these formats preserve the same information.

How to clean a table

Select the actual input format, paste the source, choose the options and click Clean Table. CSV uses commas and TSV uses tabs; there is no automatic format detection. Copy becomes available after successful processing. Editing the input or options clears the old result. Only HTML results can be moved back to the input, because Markdown input is not supported.

What HTML cleaning keeps and removes

All top-level tables are processed in source order; nested tables remain inside their parent in HTML output. Supported elements include caption, thead, tbody, tfoot, th, td, colgroup, links, images and common text formatting. Rowspan, colspan, scope and headers are retained. Scripts, event handlers, embedded documents and unsupported elements or attributes are removed. Text outside the tables is not exported. The browser may repair malformed HTML, so this is not a strict HTML validator.

Styles, whitespace and empty rows

Remove inline styles clears style, width, height and align on the table and its descendants. If disabled, supported presentation attributes and a restricted set of ordinary CSS properties remain; classes can still affect appearance on the destination site. Trimming changes cell-edge whitespace, while collapsing reduces horizontal whitespace without removing line breaks. HTML pre and code text is left unchanged. Empty-row removal keeps rows containing images, links or nested tables, and is skipped for tables containing rowspan so that cell positions are not shifted.

CSV and TSV parsing rules

Delimited input supports quoted separators, doubled quotes and line breaks inside quoted fields. All records must have equal field counts; broken quotes and irregular rows are rejected. A final line break does not create another record. Cell values remain text, including long identifiers. Trimming and whitespace options apply after parsing. For HTML output, enabling the header option makes the first remaining row column headers; disabling it retains all rows as data.

Markdown headers, line breaks and merged cells

Markdown output uses GitHub-style pipe tables. With the header option enabled, the first remaining row is the header; otherwise a blank header is added and every data row is kept exactly once. Pipes and Markdown formatting characters are escaped, HTML characters are encoded, and cell line breaks become br tags. Links become their visible text and images require non-blank alt text. Captions and column metadata are omitted with a notice. Merged cells and nested tables are rejected: use HTML to preserve them. Rendering can vary between Markdown applications.

CSV

name,role
Alice,Editor
Bob,Developer

Markdown

| name | role |
| --- | --- |
| Alice | Editor |
| Bob | Developer |

Processing limits and using the result

Input is limited to 100,000 UTF-16 units, HTML to 10,000 nodes and 60 nesting levels, tables to 5,000 cells, and output to 1,000,000 units. Processing uses the browser DOM with bounded input and a locally hosted cleaning library. The tool displays source text rather than inserting the result into the page. It does not upload your input or save it in browser storage, but shared site resources still load. Review the result before publishing; destination styles, Markdown rules and security policies still apply.