Convert ORG to JSON
Max file size 100mb.
ORG vs JSON Format Comparison
| Aspect | ORG (Source Format) | JSON (Target Format) |
|---|---|---|
| Format Overview |
ORG
Emacs Org-mode
Plain text markup format created for Emacs in 2003. Designed for note-taking, task management, project planning, and literate programming. Features hierarchical structure with collapsible sections, TODO states, scheduling, and code execution. Emacs Native Literate Programming |
JSON
JavaScript Object Notation
Lightweight data interchange format derived from JavaScript object syntax. Created by Douglas Crockford in early 2000s. The standard format for web APIs, configuration, and data storage. Human-readable yet easily parsed by machines. Data Interchange API Standard |
| Technical Specifications |
Structure: Hierarchical outline with * headers
Encoding: UTF-8 Format: Plain text with markup Processor: Emacs Org-mode, Pandoc Extensions: .org |
Structure: Nested objects and arrays
Encoding: UTF-8 (default), UTF-16, UTF-32 Format: Key-value pairs with strict syntax Processor: All programming languages Extensions: .json |
| Syntax Examples |
Org-mode syntax: #+TITLE: Project Tasks #+AUTHOR: John Doe * TODO Complete documentation DEADLINE: <2024-01-20> :PROPERTIES: :priority: high :assigned: john :END: ** Write introduction ** Add examples - Example 1 - Example 2 |
JSON output: {
"title": "Project Tasks",
"author": "John Doe",
"items": [
{
"heading": "Complete documentation",
"todo": "TODO",
"deadline": "2024-01-20",
"properties": {
"priority": "high",
"assigned": "john"
},
"children": [
{"heading": "Write introduction"},
{"heading": "Add examples",
"list": ["Example 1", "Example 2"]}
]
}
]
}
|
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2003 (Carsten Dominik)
Current Version: 9.6+ (2024) Status: Active development Primary Tool: GNU Emacs |
Introduced: 2001 (Douglas Crockford)
Standardized: RFC 8259, ECMA-404 Status: Universal standard Governance: IETF, ECMA International |
| Software Support |
Emacs: Native support (Org-mode)
Vim/Neovim: org.nvim, vim-orgmode VS Code: Org Mode extension Other: Logseq, Obsidian (plugins) |
JavaScript: JSON.parse/stringify (native)
Python: json module (built-in) Databases: MongoDB, PostgreSQL, MySQL Validators: JSONLint, JSON Schema |
Why Convert ORG to JSON?
Converting Org-mode documents to JSON makes your structured data accessible to any programming language or application. JSON is the universal data interchange format for web APIs, databases, and applications. This conversion bridges the gap between Org-mode productivity and modern software development.
JSON preserves the hierarchical structure of your Org documents. Headings become nested objects, lists become arrays, and properties become key-value pairs. This makes your Org data programmatically accessible for automation, analysis, or integration with other tools.
For developers using Org-mode for project management, converting to JSON enables integration with web dashboards, mobile apps, or data visualization tools. Your tasks, deadlines, and properties become API-ready data that can power custom applications.
Data scientists can use JSON output for analysis. Convert your research notes, structured data, or experimental logs to JSON and process them with Python, R, or JavaScript. The structured format makes it easy to extract, filter, and analyze your Org content.
Key Benefits of Converting ORG to JSON:
- Universal Compatibility: Works with every programming language
- API Ready: Perfect for web services and integrations
- Structured Data: Preserves hierarchy and properties
- Database Storage: Import directly into MongoDB, PostgreSQL
- Automation: Process Org data with scripts and tools
- Type Safety: Numbers, booleans, and strings are typed
- Data Analysis: Easy to process with data science tools
Practical Examples
Example 1: Task List to API Data
Input ORG file (tasks.org):
#+TITLE: Sprint Tasks * TODO Implement user authentication DEADLINE: <2024-01-15> :PROPERTIES: :story_points: 5 :assignee: alice :sprint: 12 :END: * DONE Design database schema CLOSED: [2024-01-10] :PROPERTIES: :story_points: 3 :assignee: bob :sprint: 12 :END: * IN-PROGRESS Build REST API :PROPERTIES: :story_points: 8 :assignee: carol :sprint: 12 :END:
Output JSON:
{
"title": "Sprint Tasks",
"tasks": [
{
"title": "Implement user authentication",
"status": "TODO",
"deadline": "2024-01-15",
"story_points": 5,
"assignee": "alice",
"sprint": 12
},
{
"title": "Design database schema",
"status": "DONE",
"closed": "2024-01-10",
"story_points": 3,
"assignee": "bob",
"sprint": 12
},
{
"title": "Build REST API",
"status": "IN-PROGRESS",
"story_points": 8,
"assignee": "carol",
"sprint": 12
}
]
}
Example 2: Knowledge Base to Searchable Data
Input ORG file (notes.org):
#+TITLE: Programming Notes * Python :PROPERTIES: :category: languages :END: ** List Comprehensions Concise way to create lists: #+BEGIN_SRC python squares = [x**2 for x in range(10)] #+END_SRC ** Decorators Functions that modify other functions. * JavaScript :PROPERTIES: :category: languages :END: ** Promises Handle asynchronous operations.
Output JSON:
{
"title": "Programming Notes",
"sections": [
{
"name": "Python",
"category": "languages",
"topics": [
{
"name": "List Comprehensions",
"content": "Concise way to create lists:",
"code": "squares = [x**2 for x in range(10)]",
"language": "python"
},
{
"name": "Decorators",
"content": "Functions that modify other functions."
}
]
},
{
"name": "JavaScript",
"category": "languages",
"topics": [
{
"name": "Promises",
"content": "Handle asynchronous operations."
}
]
}
]
}
Example 3: Meeting Notes to Database
Input ORG file (meetings.org):
#+TITLE: Team Meetings * Weekly Standup - 2024-01-15 :PROPERTIES: :attendees: alice, bob, carol :duration: 30 :END: ** Action Items - [ ] Alice: Review PR #123 - [X] Bob: Deploy to staging - [ ] Carol: Update documentation * Sprint Planning - 2024-01-12 :PROPERTIES: :attendees: alice, bob, carol, dave :duration: 60 :END:
Output JSON:
{
"title": "Team Meetings",
"meetings": [
{
"name": "Weekly Standup",
"date": "2024-01-15",
"attendees": ["alice", "bob", "carol"],
"duration": 30,
"action_items": [
{"assignee": "Alice", "task": "Review PR #123", "done": false},
{"assignee": "Bob", "task": "Deploy to staging", "done": true},
{"assignee": "Carol", "task": "Update documentation", "done": false}
]
},
{
"name": "Sprint Planning",
"date": "2024-01-12",
"attendees": ["alice", "bob", "carol", "dave"],
"duration": 60
}
]
}
Frequently Asked Questions (FAQ)
Q: How is the Org hierarchy represented in JSON?
A: Org headings become nested objects in JSON. Top-level headings become array elements, subheadings become nested "children" arrays. Properties become object keys, and the heading text becomes a "title" or "heading" field.
Q: Are TODO states and timestamps preserved?
A: Yes! TODO keywords become a "status" field, DEADLINE becomes a "deadline" field with ISO date format, SCHEDULED becomes "scheduled", and CLOSED timestamps are preserved. All Org-mode scheduling data is captured in the JSON.
Q: How are Org tables converted?
A: Tables are converted to arrays of objects, with the header row providing field names. Each table row becomes an object with keys from the header. This structure is ideal for database import or data processing.
Q: What about code blocks?
A: Code blocks are included as objects with "code" (the content) and "language" (from the #+BEGIN_SRC language specification) fields. This preserves the code for syntax highlighting or execution in other systems.
Q: Is the JSON output valid and parseable?
A: Yes, the output is valid JSON per RFC 8259. It can be parsed by JSON.parse() in JavaScript, json.loads() in Python, or any standard JSON parser. Special characters are properly escaped.
Q: Can I use this with databases?
A: Absolutely. The JSON can be imported directly into document databases like MongoDB, stored in PostgreSQL's JSONB columns, or processed into relational tables. The hierarchical structure maps well to NoSQL databases.
Q: How are Org links converted?
A: Links are converted to objects with "url" and "description" fields, or just the URL string if there's no description. Internal links (to headings) reference the heading's ID or title.
Q: Can I convert JSON back to ORG?
A: If the JSON follows the expected structure, yes. Custom scripts can convert JSON back to Org format. However, some formatting details (like exact whitespace) may differ from the original. The semantic content is preserved.