# LLM-Ready Data: Comparing the Best Formats for Web-Scraped Data > Source: https://scrape.do/blog/llm-ready-data/ Published: 2025-05-15 · Updated: 2026-09-22 · Authors: Antonello Zanini · Categories: Data Selecting the optimal LLM-ready data format is essential for maximizing efficiency and output quality in web scraping pipelines. The choice of AI data format (e.g., HTML, Markdown, JSON, or plain text) can directly affect token usage, costs, processing time, and response quality. This comparative benchmark evaluates how different data formats affect LLM performance across multiple prompts and tasks. ## Does the Format Affect How AI Processes Web Data? Most AI processing and analysis pipelines rely on data collected from web pages. This includes grounding AI responses, optimizing prices, analyzing sentiment, conducting market research, and aggregating content. However, an AI system can receive web data in many formats, from plain HTML and Markdown to JSON and images. Each format has different characteristics. Some preserve more of the original page, while others remove irrelevant content or structure the information more efficiently. As a result, formats can differ greatly in richness, input size, and token usage. These differences can affect processing time, but more importantly, they influence the quality and completeness of the resulting output. So, *does the choice of format affect how AI processes web data?* And, more specifically, *which format provides the most effective LLM-ready data and AI data format for a given task?* Let's find out! ## TL;DR: Best Data Formats for Sending Scraped Web Data to AI Check out the summary table below for the benchmark results on the most suitable LLM-ready data formats: | **Format** | **File size (KB)** | **Input tokens** | **Avg output kokens** | **Avg processing times (s)** | **Data extraction scenario** | **Summary scenario** | **Questions scenario** | | --------------------- | ------------------ | ---------------- | --------------------- | ---------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------- | | **AI-ready HTML** | 989 | 338,503 | 524.11 | 9.24 (extraction), 5.69 (summary), 4.79 (questions) | All fields populated correctly | Concise overview, features, specs, price, ratings | 10/10 answered | | **AI-ready Markdown** | 148.6 | 66,594 | 628.33 | 12.87 (extraction), 3.91 (summary), 6.63 (questions) | All fields populated correctly | Thorough hitting key points comprehensively | 10/10 answered | | **JSON** | 38.81 | 11,564 | 506.89 | 8.97 (extraction), 3.79 (summary), 4.00 (questions) | All fields populated correctly | Well-rounded concise covering price, features | 8/10 answered | | **Plain Text** | 27.4 | 6,981 | 454.22 | 10.11 (extraction), 3.27 (summary), 4.05 (questions) | All primary fields extracted; URLs, ASIN, and Best Seller as `null` | Concise capturing essentials without details | 6/10 answered | | **CSV** | 30.42 | 9,604 | 530.33 | 9.18 (extraction), 3.43 (summary), 4.39 (questions) | All fields populated correctly | Compact comprehensive hitting price, specs | 8/10 answered | | **XML** | 47.69 | 13,549 | 543.22 | 13.10 (extraction), 3.81 (summary), 4.96 (questions) | All fields populated correctly | Well-balanced capturing essentials, functional benefits | 8/10 answered | | **PNG** | 1,554 | 32,484 | 436.78 | 11.34 (extraction), 6.76 (summary), 7.65 (questions) | All primary fields extracted; URLs, ASIN, and Best Seller as `null`. | Concise well-structured capturing key details | 6/10 answered | | **PDF** | 921.91 | 30,551 | 476.78 | 12.28 (extraction), 5.81 (summary), 6.20 (questions) | All primary fields extracted; URLs, ASIN, and Best Seller as `null`. | Captures essentials concisely despite lack structure | 6/10 answered | ## A Scientific Approach to Comparing AI Data Formats Because LLMs are black boxes, finding the most suitable AI data format for a specific pipeline cannot be determined through assumptions alone. The impact of each format needs to be measured through controlled experiments using the same source data and comparable tasks. ### Input Data Formats This article compares multiple representations of the same web page across different AI tasks. The source is the following [Amazon product page](https://www.amazon.com/Owala-FreeSip-Insulated-Stainless-BPA-Free/dp/B0BZYCJK89/): ![The target web page for the benchmark](/uploads/blog/llm-ready-data-the-target-web-page-for-the-benchmark.png) The web page is collected into the following formats: | **Format** | **Description** | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | **AI-ready HTML** | The original web page markup, with scripts and styles removed to avoid exhausting the model's context window | | **AI-ready Markdown** | A cleaned and structured Markdown representation designed to retain relevant page content while removing unnecessary HTML markup | | **JSON** | Structured product data returned by an Amazon web scraper API, with information organized into predictable fields and objects | | **Plain text** | The visible text rendered on the page, without HTML structure, images, URLs, or other non-textual elements | | **CSV** | A tabular representation of the structured product data, with fields represented as columns | | **XML** | A structured representation of the product data using hierarchical XML elements | | **PNG** | A full-page screenshot representing the visual appearance of the rendered web page | | **PDF** | A printable representation of the full rendered web page, preserving its visual layout across pages | To simplify Amazon web data retrieval and conversion into multiple formats, the benchmark uses an [all-in-one web scraping API such as Scrape.do](https://scrape.do/blog/best-web-scraping-api/), combined with custom Python logic where required. ### Evaluation Prompts Each representation of the scraped page is then tested against these prompts: | **Prompt type** | **What it measures** | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Data extraction** | Tests whether the format contains enough structured and detailed information for the model to reliably extract a predefined set of product fields. | | **Summary** | Tests how effectively the model can identify and condense the most relevant information while preserving important factual details. | | **Questions** | Tests whether the format provides sufficient information to answer targeted questions, including information that may be difficult to extract from less structured representations. | **Note**: The prompts will be run using [GPT-5.6 Terra](https://developers.openai.com/api/docs/models/gpt-5.6-terra). However, the benchmark can be easily adapted to use any other AI model. For each combination of data format and prompt, 3 independent runs are performed. Repeating each test helps verify whether results remain consistent across runs and reduces the potential impact of the probabilistic nature of LLM responses. ### Metrics The following metrics are recorded for every run: | **Metric** | **Description** | | --------------------- | --------------------------------------------------------------------------------- | | **Input file size** | Size of the source file (in KB) provided to the benchmark. | | **Input tokens** | Total tokens generated from the input data and sent as model input. | | **Full input tokens** | Tokens attributable to the input + prompt. | | **Output tokens** | Number of tokens generated by the model in its response. | | **Total tokens** | Combined input and output tokens reported for the request. | | **Processing time** | Time (in seconds) required to process the request and produce the model response. | The article also includes a qualitative analysis of the output produced for each prompt during the first run for each AI data format. This could potentially be replaced with an [LLM-as-a-judge workflow](https://www.sciencedirect.com/science/article/pii/S2666675825004564) for a more automated evaluation. Together, these measurements provide a practical basis for evaluating which representations are most suitable for LLM-ready data and different AI processing tasks. ## Setup and Initial Steps Discover how to get started and how the benchmarking logic has been implemented. ### Prerequisites To run the benchmark locally, make sure you have the following: - Python 3.11 or later installed - An [OpenAI API key](https://platform.openai.com/api-keys) - A [Scrape.do API token](https://scrape.do/documentation/#generate-api-token) Clone the [repository supporting this article](https://github.com/Tonel/llm-data-formats-benchmark) with: ```bash git clone https://github.com/Tonel/llm-data-formats-benchmark.git ``` Then, follow the [“Getting Started” instructions](https://github.com/Tonel/llm-data-formats-benchmark#getting-started) to set up the Python virtual environment and install the required dependencies. ### Getting Started With Scrape.do [Log in to your Scrape.do account](https://dashboard.scrape.do/login). If you do not have an account yet, [create one](https://dashboard.scrape.do/sign-up). After logging in, you will be redirected to the “Playground’ section of your account. To get your API token, click “Copy to clipboard” in the “Your API Token” section on the bottom left: ![Copying your Scrape.do API token](/uploads/blog/llm-ready-data-copying-your-scrape-do-api-token.png) A Scrape.do API token is required to authenticate requests to the Web Scraping API, Amazon Web Scraper API, and Proxy Mode. [Explore the documentation for more details](https://scrape.do/documentation/). **Note**: An API token is automatically generated when you subscribe. To manage your existing tokens or create a new one, go to “Settings → API Token”. ### Benchmark Project The project is based on the file structure below: ``` llm-data-formats-benchmark/ ├── benchmark.py # Main benchmarking script ├── get_html.py # Collects Amazon product data in HTML format ├── get_json.py # Collects Amazon product data in JSON format ├── get_markdown.py # Collects Amazon product data in Markdown format ├── get_pdf.py # Generates PDF via browser automation ├── get_csv.py # Converts JSON data to CSV format ├── get_xml.py # Converts JSON data to XML format ├── get_plain_text.py # Extracts plain text version via browser automation ├── get_screenshot.py # Captures page screenshot (in PNG) via browser automation ├── requirements.txt # Python dependencies ├── README.md # Project documentation ├── .env # Stores the required API keys ├── input/ # Stores the data generated by the get_*.py scripts │ ├── product.html │ ├── product.json │ ⋮ │ └── product.png └── output/ # Benchmark results generated by benchmark.py └── / ├── extraction.json ├── summary.json └── questions.json ``` The project follows a two-phase workflow: 1. **Data collection**: Run the `get_*.py` scripts to fetch Amazon product info and convert it to different LLM-ready data formats. 2. **Benchmarking**: Run `benchmark.py` against files in the `input/` directory. The script processes each input file, sends it to the LLM with a specific prompt (`extraction`, `summary`, or `questions`), and measures token consumption and processing time. Results are automatically saved to the `output/` directory organized by format and test case. For detailed information on how the benchmark works, including the exact prompts, implementation logic, and other details, refer to the files in the [benchmark repository](https://github.com/Tonel/llm-data-formats-benchmark#getting-started). ## AI-Ready HTML HTML is the native data format used to represent web pages, but *is it the most suitable format for AI processing?* ### Retrieving the Data You can retrieve any web page's HTML using the Scrape. do Web Scraping API with: ```python from dotenv import load_dotenv import os import requests # Load environment variables from .env file load_dotenv() # Read the Scrape.do API token from the environment variable SCRAPE_DO_API_TOKEN = os.getenv("SCRAPE_DO_API_TOKEN") # Scrape the target URL using the Scrape.do Web Scraping API params = { "token": SCRAPE_DO_API_TOKEN, "url": "https://www.amazon.com/Owala-FreeSip-Insulated-Stainless-BPA-Free/dp/B0BZYCJK89/", "super": True, "geoCode": "us", } response = requests.get("https://api.scrape.do/", params=params) # Retrieve the HTML content from the response html = response.text # HTML optimization logic... # Export the scraped HTML content to a file with open("input/product.html", "w", encoding="utf-8") as file: file.write(html) ``` Note the use of the [`super`](https://scrape.do/documentation/proxies/super/) parameter to enable routing through high-quality residential proxies, improving the request’s success rate. Also note the [`geoCode`](https://scrape.do/documentation/proxies/geo-code/) parameter set to `us`, which routes the request through a US-based proxy. For more information on how to call the Scrape.do Web Scraping API, [refer to the official documentation](https://scrape.do/documentation/). This produces `input/product.html`. In this case, the raw file was 2.64 MB. That is over one million tokens, exceeding the [context supported by GPT-5.6 Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna). To make the test possible, the HTML was therefore stripped of `