← Blog

Structured vs Unstructured Data: Examples, Storage and LLMs

Structured data has a fixed schema. Every record carries the same named fields with the same types, which is why it fits in a table and answers to SQL. Unstructured data has no schema: the facts sit inside an email, a PDF, a photo or a recording, and nothing tells software where to look.

Semi-structured data sits between the two. JSON, XML and CSV files carry labels with every record, but the set of fields can change from one record to the next.

A quick test: if you can write a query against it right now, it’s structured. If a person has to read it first, it’s unstructured. Most of the work in a modern data stack is moving things from the second bucket into the first.

Structured vs unstructured data in one table

StructuredSemi-structuredUnstructured
SchemaFixed. Same columns and types in every rowLabels travel with each record, fields can varyNone. The meaning lives inside the content
ExamplesOrders table, ledger, stock counts, CRM fieldsJSON from an API, webhook payloads, XML feeds, log lines, email headersEmail bodies, PDFs, scans, photos, call recordings, chat logs
Lives inRelational database, warehouseJSON columns, variant columns, data lake filesInbox, help desk, shared drive, object storage
Read withSQL, BI toolsJSON operators, or flatten into tablesExtract fields with a model first, or search by meaning
Usual failureSchema changes need migrationsField names and types drift between versionsExtraction returns a wrong value that looks right

What is structured data?

Structured data sits in a predefined model: named columns, fixed types, 1 row per record. An orders table with order_id, customer_id, placed_at, total and status is the textbook case.

The database enforces the shape. A date column rejects “sometime next week” and a total has to be a number. That strictness is what makes structured data cheap to sum, filter, join and chart.

In a store or a SaaS company it looks like:

  • Orders, refunds and payouts
  • Subscription records and the invoices your billing tool issues
  • Stock levels per SKU and warehouse
  • CRM fields: deal stage, owner, close date
  • Ad spend and conversions by channel

Its limit is that it only holds what someone decided to capture. Your returns table has a reason dropdown, and the most common answer is “Other”. The actual reason (“zip broke after 2 wears”) is sitting in an email.

Changing the schema costs real time, too. A new column means a migration, a backfill and a pass through every report that reads the table.

What is semi-structured data?

Semi-structured data describes itself. Each record carries its own labels, so a program can find “email” or a price tag without a table definition, but 2 records don’t have to share the same fields.

Where you meet it:

  • JSON responses from APIs and webhook payloads (an order webhook from your store platform is a good example)
  • XML product feeds and sitemaps
  • Email headers (From, Date and Subject are labelled, the body is free text)
  • Application logs with key-value pairs
  • CSV exports whose columns shift between runs

Databases handle it natively now. PostgreSQL’s jsonb type stores JSON in a decomposed binary format that the docs call “significantly faster to process” than plain json, and it takes GIN indexes so you can search keys and values across millions of documents. Snowflake loads JSON, Avro, ORC, Parquet and XML into its VARIANT, OBJECT and ARRAY types.

The pain is drift. An API renames shipping_cost to shippingCost in version 2, an array that always held 1 item starts holding 3, and a number arrives as a string. Pipelines rarely crash on this. They quietly load nulls (which you discover 3 weeks later, in a board deck), so put checks on the fields you depend on.

What is unstructured data?

Unstructured data has no predefined model. The information is there, but nothing labels it, so you can’t query it until something reads it first.

In a typical business:

  • Email and chat: customer questions, supplier threads, sales replies
  • Documents: contracts, supplier invoices, policy PDFs, scanned forms
  • Handwriting: delivery notes, intake forms, signed paperwork (see our guide to handwriting OCR)
  • Media: product photos, damage-claim photos, call recordings, demo videos
  • Public text: reviews, social posts, forum threads about your brand

It’s also the bulk of what a company holds. An IDC white paper sponsored by Box, dated August 2023, puts it at 90% of an organization’s data. That’s an analyst estimate across many companies, paid for by a vendor that sells content management, so treat it as a ceiling to check your own count against. We go deeper on volumes and tooling in our piece on unstructured data.

Is a PDF structured or unstructured?

To you, a PDF invoice looks structured. Every one has a number, a date, line items and a total.

To software it’s unstructured. Each supplier puts those fields somewhere different, half the files are scans with no text layer, and tables split across pages. Older setups handled this with 1 template per supplier layout, which is why they broke every time a supplier redesigned their invoice. Our guide to invoice automation covers how that works now.

Where each type is stored and what reads it

Structured data lives in relational databases (PostgreSQL, MySQL, SQL Server) for live apps and in a warehouse for reporting. SQL or a BI tool reads it.

Semi-structured data goes into JSON columns, warehouse variant columns, or files in a data lake that get flattened into tables on load. JSON path operators read it, or you parse it into columns first.

Unstructured data mostly stays where it was created: the inbox, the help desk, the shared drive, the call platform. Teams that process it at scale keep the original file and add 2 derived layers beside it:

  1. Extracted fields in an ordinary table (order number, amount, reason, sentiment), each row linked back to the source file
  2. Embeddings in a vector index, so the text can be searched by meaning

An embedding is a vector of floating point numbers where the distance between 2 vectors measures how related the texts are. pgvector adds that kind of search to Postgres with HNSW and IVFFlat indexes, so the vectors can sit in the same database as your orders table.

How LLMs changed working with unstructured data

Until roughly 2023, turning unstructured data into structured data meant OCR, 1 template per layout, keyword rules, and people keying in whatever the rules missed. 3 things changed.

Models return data in your schema

You define the fields you want and the model fills them in. OpenAI’s Structured Outputs feature “ensures the model will always generate responses that adhere to your supplied JSON Schema”. Anthropic’s version compiles your schema into a grammar and uses constrained decoding, so the output always parses. Both pages list exceptions: a refusal or a hit on the token limit can still break the shape.

That removed a whole category of glue code. You no longer write parsers for half-formatted model replies.

The schema guarantees the shape of the answer. Whether the invoice number inside it is correct is still your job to check.

Models read the document itself

You can send the PDF straight to the model. Claude converts each page into an image and passes the extracted text alongside it, so tables, charts and stamps on a scan get read in the same request. The limit is 600 pages per request (100 when the context window is under 1M tokens), and the docs estimate 1,500 to 3,000 text tokens per page plus image tokens. Gemini takes PDFs up to 50MB or 1,000 pages and counts each page as 258 tokens.

For most business documents that means no separate OCR step and no template per supplier.

Text became searchable by meaning

Keyword search misses “parcel never showed up” when you search for “missing delivery”. Embedding search catches it, because the 2 phrases land close together in vector space. Add an LLM that answers only from the retrieved passages and you have question answering over your own files (the pattern usually called RAG).

Where it still breaks

  • Plausible wrong values. A misread digit in an IBAN still produces valid JSON. Add validation (check digits, line items that sum to the total, dates inside a sane range) and route failures to a person.
  • Long inputs. A 2023 study by Liu et al. found model performance “is often highest when relevant information occurs at the beginning or end of the input context” and drops when it sits in the middle. Split long files and ask for page references.
  • Silent drift. A new supplier, a new email template or a new product line can lower accuracy with no error message. Re-check a sample every month.

Which type do you need?

All 3, and the work is converting between them. The setup we’d start with:

  1. Leave the raw unstructured source where it is (inbox, drive, help desk).
  2. Decide the 5 to 10 fields you’d actually query and write them down as a schema.
  3. Extract those fields into a table, with a link from every row back to the source.
  4. Send low-confidence or high-stakes extractions to a person before anything acts on them.

Say a 12-person apparel store gets 250 support emails a week. The emails stay in the help desk. An extraction step writes order_id, issue_type, carrier and refund_requested into a table. “How many damaged-in-transit claims did we get last month, by carrier?” becomes a 1-line query. Before, it was an afternoon of reading.

That’s the pattern our customer inbox agent runs: it reads the unstructured email, pulls the structured order record, and drafts a reply that a person approves before it goes out.

FAQ

Is JSON structured or unstructured data?

Semi-structured. Every value has a label, so software can find it, but records don’t need identical fields. PostgreSQL stores it in a jsonb column you can index and query with SQL.

Is email structured or unstructured data?

Both. The headers (sender, date, subject, message ID) are labelled and machine-readable. The body is free text, so it’s unstructured until something extracts the facts from it.

What percentage of data is unstructured?

IDC put it at 90% in an August 2023 white paper sponsored by Box. It’s an estimate across organizations, so count your own files before you plan around it.

Can you query unstructured data with SQL?

After a conversion step, yes. Either extract fields into tables first, or store embeddings (pgvector does this inside Postgres) and run similarity search next to your normal queries.

Is a spreadsheet structured data?

A sheet with 1 header row and consistent columns is structured. A sheet with merged cells, notes in random cells and 3 tables on 1 tab behaves like semi-structured data at best, and you’ll want to clean it before loading it anywhere.

AutomationHero

Want an agent to take this job off your plate?

We install AI agents for ecommerce and SaaS teams in one session. You approve what they send, and the first result lands the next morning.

Book a callSee the agents

Not sure where to start? Take the 2-minute scorecard →