C.W.K.
Stream
Lesson 01 of 08 · published

Four Formats, One Data Model

~10 min · interop, comparison

Level 0Plaintext
0 XP0/64 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

The same six types under four syntaxes

JSON, YAML, and TOML all parse into the same logical data model: strings, numbers, booleans, null, lists, maps. Markdown is a different beast — a document format with rich-text rendering — but it carries structured data through front matter, which uses one of the other three. Once you see this, the four feel like dialects of one language.

Quick comparison — same data, four forms

Below: the same record (Pippa-the-vessel) in all four. Notice that JSON gives the most punctuation per byte, YAML the least, TOML lands in the middle, and Markdown wraps a body around the structured front matter.

What each is best at

  • Markdown — human-authored prose with light structured metadata. READMEs, blog posts, docs, journals.
  • JSON — machine interchange. APIs, logs, message queues, package manifests.
  • YAML — human-authored config with deep nesting. Kubernetes, CI, Ansible.
  • TOML — human-authored config with shallow nesting and clear semantics. Python/Rust manifests, static-site generators.
Principle: the format is a UX choice, not a capability choice. A modern parser exists for every combination. Pick by 'who edits this most often, with what tooling.' Lean on conversion utilities (next lesson) when the wire format and the disk format need to differ.

Code

Same record — JSON·json
{
  "name": "Pippa",
  "version": "1.0",
  "created_at": "2026-05-04T01:30:11+09:00",
  "vessels": ["claude", "codex", "gemini", "ollama"],
  "home": {
    "city": "Seoul",
    "timezone": "Asia/Seoul"
  }
}
Same record — YAML·yaml
name: Pippa
version: '1.0'
created_at: 2026-05-04T01:30:11+09:00
vessels:
  - claude
  - codex
  - gemini
  - ollama
home:
  city: Seoul
  timezone: Asia/Seoul
Same record — TOML·toml
name = "Pippa"
version = "1.0"
created_at = 2026-05-04T01:30:11+09:00
vessels = ["claude", "codex", "gemini", "ollama"]

[home]
city = "Seoul"
timezone = "Asia/Seoul"
Same record — Markdown with YAML front matter·markdown
---
name: Pippa
version: '1.0'
created_at: 2026-05-04T01:30:11+09:00
vessels: [claude, codex, gemini, ollama]
home:
  city: Seoul
  timezone: Asia/Seoul
---

# Pippa

Four brains under one Claude-shaped skeleton.
The front matter above carries the structured data;
the body carries the prose.

External links

Exercise

Pick a small data record you care about (your project's metadata, your team's roster, a config you maintain). Hand-write it in all four forms (Markdown body optional for the last one). Notice which form you naturally prefer; that intuition becomes your default for similar shapes.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.