Skip to converter

HTML table to CSV — markup is not a spreadsheet, and layout does not survive

A vendor publishes a price page and you need the rows in a spreadsheet. Reading the markup gives you the cell text and nothing else: the table's structure — merged headers, spans, nested markup — is presentation, and a flat delimited file has no way to express it.

Cell formatting, colours, column widths and merged ranges are dropped; only stored values survive.

Drop files here or HTML, up to 12 MB
    Add a file to start.

    Processed on your device. Files aren’t sent anywhere.

    No sign-up. Nothing to install.

    Only the cell text travels

    The reader takes each cell's text. Everything describing how the page looked stays behind.

    • Text inside a cell is kept, including nested markup's text.
    • Inspect punctuation and spacing in the extracted text before treating it as clean import data.
    • Links contribute their text, not the destination.
    • Scripts and styles contribute nothing.
    • Tables in the document become sheets; sheet mode decides how many are written.

    Rowspans and colspans have no counterpart

    A header cell spanning three columns supplies one label where the data rows have three cells. CSV cannot record that a label covered several columns, so the shape has to be repaired afterwards.

    MarkupIn the CSVConsequence
    Header labelled Region spanning three columnsone fieldfewer labels than data cells
    Cell labelled Total spanning two rowsone field in the first rowsecond row starts one cell early
    A cell displaying $12$12currency arrives as text
    A cell displaying an encoded ampersand&entity decoded

    Entities and formatting inside cells

    Entities are decoded, so an ampersand or a non-breaking space arrives as the character it represents. Currency symbols, bold text and footnote markers remain part of the text, which is why a price column usually needs a cleanup pass before it can be summed.

    What the CSV keeps and drops

    The output is UTF-8 with a byte order mark and CRLF line endings, so spreadsheet software reads accented characters correctly. Kept: cell text, decoded entities, row order. Dropped: spans, styling, links, captions, nested tables as structure.

    A copied price table may contain currency signs, footnote markers and thousands separators inside the displayed cell text. Those characters can be meaningful to a reader while confusing a numeric importer. Extraction does not decide your data schema. Check one price with punctuation and one empty price before importing the complete file; keep descriptive notes out of arithmetic columns in the receiving system.

    Checking the extracted rows

    Because layout is not reconstructed, the row shape is the thing to verify.

    1. Convert the .html file and download the CSV.
    2. Open it in a text editor so nothing is retyped.
    3. Compare the field count of the header row with the data rows.
    4. Repair any row that a span shifted.
    5. Strip currency symbols before importing numbers.

    Questions

    Does a colspan header become three columns?
    No. A merged cell supplies one field, so the header row can have fewer fields than the data rows. Repair the header afterwards.
    What happens to rowspan?
    The value appears once, in the row where the merged cell starts. Later rows have one fewer cell, which shifts their columns.
    Are HTML entities decoded?
    Yes. Entities become the characters they represent, so an ampersand arrives as a plain ampersand.
    Do links survive?
    Only the link text. Destinations, classes and styling are not part of a delimited file.

    Share this converter

    More sharing options