# Shapes of data — JSON, CSV, documents

> **What you will learn**
> Structured versus unstructured data, how to read JSON and CSV, why PDFs and
> Hangul documents cost extra work, and why text turns to garbage.

## Structured or not

| | Structured | Unstructured |
|---|---|---|
| Shape | tables, fields and values | prose, images |
| Examples | databases, CSV, JSON | reports, email, meeting notes, PDFs |
| A machine can | compute directly | **only read and interpret** |
| How much a company has | little | **most of it** |

**The bottom row is why AI is worth something inside a company.** Existing
systems only ever handled the structured part, and most corporate material is
prose. Language models work on prose.

## JSON — how programs exchange things

The block of text from [the exercise](/guide/it-try-http). Three rules.

```json
{
  "name": "Jinho Kim",
  "active": true,
  "departments": ["Sales", "Planning"],
  "manager": { "name": "Sumin Lee", "email": "sumin@example.com" }
}
```

| Symbol | Meaning |
|---|---|
| `{ }` | a group of "name: value" pairs |
| `[ ]` | a list, in order |
| `"…"` | text. Numbers and `true`/`false` take no quotes |

**It nests.** Above, the value of `manager` is another `{ }`. Shapes a table
cannot hold fit here.

> If it is hard to read, ask an agent to "turn this JSON into a table". Faster
> than counting brackets.

## CSV — a table as text

It looks like a spreadsheet file. **It is not.**

```csv
date,region,returns
2026-08-01,Seoul,14
2026-08-01,Busan,3
```

| | CSV | Excel (.xlsx) |
|---|---|---|
| Contents | text only | formatting, formulas, several sheets |
| File | text — **readable as is** | binary — needs opening |
| Exchange | any program | the spreadsheet family |

**CSV is the easier hand-off to an AI.** Values containing a comma must be
quoted (`"Seoul, Gangnam"`), and saving from a spreadsheet as CSV **drops the
formulas and keeps only the results.**

## Markdown — what this manual is written in

Text where a few symbols carry the formatting: `**bold**`, `# heading`.

```markdown
## Heading
- list item
**emphasis**
```

**AI output is usually Markdown** because it is text you can manipulate directly
while keeping heading, list and table structure. Convert it to HWPX or PDF later
if you need to ([Working with Korean official documents](/guide/ht-korean-docs)).

## Why PDFs and Hangul documents cost more

A PDF is **a format for printing.** It records "this glyph at this coordinate at
this size", and often carries no structure for tables or paragraphs at all.

```mermaid
graph TD
  A["PDF · HWP · scanned image"] --> B["pull the characters out<br/>extraction · OCR"]
  B --> C["text · Markdown"]
  C --> D["the AI reads it"]
```

| Source | Difficulty |
|---|---|
| PDF generated from text | easy — the characters are in there |
| **Scanned PDF, photo** | hard — needs **OCR** (reading text from an image) |
| Table-heavy documents | hard — the cell structure collapses easily |

**Most of "the AI cannot read our documents" is this step.** The model is not
being dense; the characters were never there.

## Why text turns to garbage — encoding

Encoding is the agreement for turning characters into numbers. **Save with one
agreement and read with another and you get garbage.**

```
✓ UTF-8            today's standard, covers every script
✗ EUC-KR · CP949   older Korean encodings, still alive in legacy systems
```

The classic symptom:

```
�섎룞蹂닿퀬??   → the encodings disagree
안녕하세요        → fine
```

**If a CSV opens with broken Korean in a spreadsheet**, the file is UTF-8 and
the spreadsheet read it as CP949. The file is not damaged.

## Choosing what to exchange

```
□ Tabular numbers            → CSV
□ Between programs           → JSON
□ A document for people      → Markdown, converted to PDF/HWPX if needed
□ Original is a PDF or scan  → plan an extraction step first
```

## Common misconceptions

### "Can't I just upload the spreadsheet?"

**You can.** A conversion to text happens inside, and formatting, formulas and
merged cells are lost along the way. If the result looks wrong, suspect that
step.

### "Isn't PDF the standard?"

**For exchanging and printing, yes.** For processing again, it is close to the
worst choice. If the original (spreadsheet, document, Markdown) exists, send
that.

---

## Check yourself

**1. The main difference between CSV and a spreadsheet file?**

<details>
<summary>Answer</summary>

**CSV is text, a spreadsheet file is binary.** CSV reads as is but carries no
formatting, formulas or multiple sheets.
</details>

**2. Why is a scanned PDF harder than a text PDF?**

<details>
<summary>Answer</summary>

**The characters are an image.** OCR has to read them out of the picture first.
</details>

**3. Text arrives as garbage characters — what do you suspect?**

<details>
<summary>Answer</summary>

**Encoding.** The agreement used to save and the one used to read disagree —
UTF-8 read as CP949, for instance.
</details>

---

Next, where structured data actually lives →
[What a database is](/guide/it-database)
