HTML table to JSON array

Th calculator converts the html table code to JSON array with optional data transpose and compression. It also visualizes numeric data on chart.

This page exists due to the efforts of the following people:

Anton

Timur

Timur

Created: 2017-03-31 09:21:22, Last updated: 2021-03-20 15:29:31

This calculator extracts structured data from HTML. Copy HTML table code to Html table field and get well-formed JSON representation.
The calculator removes all leading and trailing spaces. Use Numeric data parameter to convert data in numeric form. Data compression becomes available for numeric data.

PLANETCALC, Convert HTML table to JSON

Convert HTML table to JSON

Digits after the decimal point: 2
JSON
 
Compression ratio
 
Comma separated string numbers or string number ranges. String number starts with 1.
Data chart
The file is very large. Browser slowdown may occur during loading and creation.

Numeric table data compression algorithm

The calculator code (Licensed under CC-SA) contains an experimental algorithm for smooth function table data compression. The algorithm compresses data per row, forming an array of rows containing numbers and single-byte UTF-8 strings compatible with HTML.
I observed a maximum compression ratio of 31:1 during my experiments with big table data for Petroleum product density converter.

Due to the algorithm works on a single table row, consequent data must also be placed in rows to compress it effectively. If your table contains consequent data in columns, you should switch on the transpose option to replace rows with columns.

The compression works only with numeric data; empty cells must be replaced with some value (0 by default). You may explicitly set a placeholder value if zero does not suit you.

URL copied to clipboard
PLANETCALC, HTML table to JSON array

Comments