Back to Nodes

CsvJsonHtmltableConverter

Last updated Dec 25, 2025

A comprehensive n8n node for seamless bidirectional conversion, replacement, and styling of HTML tables, CSV, and JSON formats. Features advanced table selection (including Table With Caption, Table Under Heading, Last Table), Style and Replace operations

7 Weekly Downloads
123 Monthly Downloads

Included Nodes

CsvJsonHtmltableConverter

Description

n8n-nodes-csv-json-htmltable-converter

This is an n8n community node that provides seamless bidirectional conversion between HTML tables, CSV, and JSON formats, with advanced table selection, replacement, and styling features.

)

  • n8nObject output for direct workflow integration
  • Comprehensive input validation and error messages
  • UI/UX enhancements for easier configuration
  • Debug logging for development/troubleshooting
  • Installation

    Follow these instructions to install this node for your n8n instance:

    npm install n8n-nodes-csv-json-htmltable-converter
    

    Usage

    1. Add the “CSV JSON HTMLTable Converter” node to your workflow
    2. Select the operation: Convert, Replace, or Style
    3. Configure the source/target format, input data, and options as needed
    4. For advanced table selection, use presets or custom selectors
    5. Set the output field name
    6. Run the workflow to process your data

    Operations

    Convert

    Transform data between HTML, CSV, and JSON formats. Use advanced table selection presets or custom selectors for precise extraction.

    #### Heading Detection for Multiple Tables
    When processing multiple tables from HTML, you can enable heading detection to use preceding elements as identifiers in the output:

    1. Enable Multiple Tables/Objects
    2. Enable Enable Heading Detection
    3. Specify a Heading Selector (CSS selector, e.g., div.term-date span.year)

    Output Format:

  • Without heading detection: [{data: [...]}, {data: [...]}]
  • With heading detection: {"2025": [...], "2026": [...]}
  • The heading selector should target elements that appear before each table in the HTML structure. If no heading is found, tables fall back to table1, table2, etc. Duplicate headings are automatically handled with numeric suffixes.

    Replace

    Replace an existing HTML table in a document with new content (HTML, CSV, or JSON). Supports all table selection presets and advanced selectors.

    Style

    Apply custom styles to HTML tables, including CSS classes, inline styles, zebra striping, border styles, caption styling, and more. Ideal for preparing tables for display, reports, or emails.

    #### Style Operation Parameters

  • HTML Input: The HTML string containing the table(s) to style
  • Table Class: CSS class to add to
  • Table Style: Inline CSS for
  • Row Style: Inline CSS for
  • (optional)
  • Cell Style: Inline CSS for
  • /

    (optional)
  • Zebra Striping: Enable/disable alternating row colours
  • Even Row Colour: Background colour for even rows (if zebra striping enabled)
  • Odd Row Colour: Background colour for odd rows (if zebra striping enabled)
  • Border Style: Border style for
    (e.g. solid, dashed, none)
  • Border Width: Border width for
  • (e.g. 1px, 2px)
  • Caption Style: Inline CSS for
  • (optional)
  • Caption Position: Position of the
  • (top or bottom)
  • Output Field: The name of the output field to store the styled HTML (default: styledHtml)
  • #### Example: Styling an HTML Table

    Input HTML:

    Monthly Sales
    MonthSales
    January100
    February120

    Style Operation Parameters:

  • Table Class: my-table
  • Table Style: width: 100%; border-collapse: collapse;
  • Row Style: font-size: 16px;
  • Cell Style: padding: 8px;
  • Zebra Striping: true
  • Even Row Colour: #f2f2f2
  • Odd Row Colour: #ffffff
  • Border Style: solid
  • Border Width: 1px
  • Caption Style: font-weight: bold; color: #333;
  • Caption Position: top
  • Output HTML:

    Monthly Sales
    Month Sales
    January 100
    February 120

    Table Selection Presets

  • All Tables: Finds all table elements in the document
  • First Table Only: Finds only the first table in the document
  • Last Table: Finds the last table in the document
  • Table With Caption: Finds a table with a
  • element, optionally filtered by caption text. Caption is included in output (JSON, CSV, HTML).
  • Table Under Heading: Finds a table after a heading of a specific numeric level (1–999) and (optionally) containing specific text. Table index logic only counts direct sibling tables after the heading.
  • Custom: Use your own custom selector (for advanced users)
  • Output and n8nObject Format

  • n8nObject output: Directly outputs JavaScript objects for use in n8n workflows. Single-item arrays are unwrapped; multi-item arrays are wrapped in the output field.
  • Output field: All results are wrapped in the specified output field (default: convertedData), except for n8nObject output, which is always in the json property.
  • Heading-based keys: When heading detection is enabled for multiple tables, output uses heading text as object keys instead of array indices, making data more meaningful and easier to access.
  • Chaining: Improved detection and handling of n8nObject input/output for seamless chaining between nodes.
  • Breaking Changes and Migration Notes

  • Removed deprecated presets: ‘Tables With Headers’, ‘Tables in Main Content’, and ‘Data Tables’ presets have been removed. Use supported presets instead.
  • Table Under Heading: Heading level is now a numeric input (1–999). Table index logic only counts direct sibling tables after the heading.
  • Output format changes: Output wrapping and field naming are now consistent across all formats. n8nObject output is always in the ‘json’ property.
  • Migration: Review your workflows for use of removed presets and update to supported options. If using Table Under Heading, ensure headingLevel and tableIndex parameters are set correctly. Review output field usage and update downstream nodes if needed.
  • Debug Logging

  • Optional debug logging is available for development and troubleshooting. Set NODE_ENV to development to enable detailed logs.
  • License

    MIT

    ![Buy Me A Coffee](https://buymeacoffee.com/msoukhomlinov)

    n8n is a fair-code licensed workflow automation platform.