JSON feeds data. JSONL trains models. Markdown communicates results. Master all three and you'll understand the complete lifecycle of modern AI.
Every large language model uses all three formats at different stages. Here's the complete picture.
A lightweight, text-based, language-independent data interchange format. Standardized as RFC 8259 (IETF) and ECMA-404. Created by Douglas Crockford in 2002.
{ "model": "gpt-4o", "version": 2024, "active": true, "temperature": 0.7, "system_prompt": null, "capabilities": [ "text", "vision", "code" ], "limits": { "max_tokens": 128000, "rate_limit": 10000 } }
One JSON object per line. No wrappers. Pure streaming. This is the format that powers fine-tuning for GPT, Llama, Mistral, and virtually every major LLM.
null is valid; an empty line is not.
\n — \r\n is also supported. A final newline is recommended but not required.
// Line 1 — one complete example {"messages":[{"role":"system","content":"You are a helpful AI."},{"role":"user","content":"What is JSON?"},{"role":"assistant","content":"JSON is a lightweight data format."}]} // Line 2 — next independent example {"messages":[{"role":"user","content":"Explain JSONL"},{"role":"assistant","content":"JSONL is one JSON per line."}]} // Line 3 — continues forever, one per line {"messages":[{"role":"user","content":"What is Markdown?"},{"role":"assistant","content":"A plain text formatting language."}]}
import json # ── Read JSONL ────────────────── with open('data.jsonl', 'r') as f: for line in f: obj = json.loads(line.strip()) print(obj) # process each # ── Write JSONL ────────────────── records = [ {"role": "user", "text": "Hello"}, {"role": "assistant", "text": "Hi!"} ] with open('out.jsonl', 'w') as f: for r in records: f.write(json.dumps(r) + '\n')
Created by John Gruber in 2004. Today it's the default output format for every major AI system — ChatGPT, Claude, Gemini, and Grok all output Markdown by default.
# Heading 1 ## Heading 2 ### Heading 3 Plain paragraph text here. **bold text** *italic text* `inline code` ```python # fenced code block print("hello world") ``` - Unordered list item - Another item - Nested item 1. Ordered list 2. Second item [Link text](https://example.com) > Blockquote text here | Col 1 | Col 2 | (GFM only) |-------|-------| | data | data |
| Flavor | Creator | Year | Extra Features | Used By |
|---|---|---|---|---|
| Original Markdown | John Gruber | 2004 | — | Daring Fireball |
| CommonMark | MacFarlane, Atwood | 2014 | Unambiguous spec, test suite | GitHub, Reddit, Discourse |
| GFM | GitHub | 2017 | Tables, task lists, strikethrough | GitHub, GitLab |
| MDX | Community | 2018 | JSX components in Markdown | Next.js, Gatsby docs |
From data collection to fine-tuning to deployment — JSON, JSONL, and Markdown each play a critical role in the modern LLM lifecycle.
| Property | JSON | JSONL | Markdown |
|---|---|---|---|
| Primary Use | API data, configs | Training datasets | Formatted text |
| Human Readable | ✓ With formatting | ✓ Line-by-line | ✓✓ Native |
| Streamable | Needs full parse | ✓✓ Line-by-line | ✓ Paragraph-by-para |
| Token Efficiency | Medium | High (no wrappers) | Very High |
| Official Standard | RFC 8259, ECMA-404 | jsonlines.org | CommonMark, GFM |
| File Extension | .json | .jsonl | .md, .markdown |
| MIME Type | application/json | application/jsonl | text/markdown |
Validate, convert, and preview JSON, JSONL, and Markdown directly in your browser. No signup required.
Deep dives on JSON, JSONL, Markdown, and how they power modern AI systems.