Org’s syntax is defined by its Emacs implementation, org-element.el, and
described in the Org Syntax document on Worg, which this page follows. A file
is plain text, normally UTF-8. It is split into a tree: the zeroth section before the
first heading, then headings, each with an optional section of content and child
headings. Elements are recognised line by line; objects (inline markup) inside them are
on the objects page.
Headings
STARS KEYWORD PRIORITY COMMENT TITLE TAGS, on one line starting in the
first column:
| Part | Syntax | Meaning |
|---|---|---|
| STARS | One or more *, then a space | The level: one star is level 1. With org-odd-levels-only only odd counts are used. |
| KEYWORD | A TODO keyword, case-sensitive | The task state. By default TODO (open) and DONE (closed); #+TODO: changes the list (see below). |
| PRIORITY | [#A] to [#Z], or [#0] to [#64] | The priority; by default A is highest, C lowest and B the default. |
| COMMENT | The word COMMENT, case-sensitive | The heading and its subtree are left out of export. |
| TITLE | Any text with objects | The heading’s text. If it matches org-footnote-section (“Footnotes”), it is the footnote section. |
| TAGS | :tag1:tag2: at the end of the line | Tags of letters, digits, _, @, # and %. Tags are inherited by child headings. The tag ARCHIVE marks an archived subtree, folded and skipped. |
** TODO [#A] COMMENT Write the report :work:urgent:
Planning line
The line directly after a heading (no blank line between) may hold one or more of
DEADLINE:, SCHEDULED: and CLOSED:, each followed
by a timestamp:
* DONE Pay the rent
CLOSED: [2026-11-01 Sun 09:12] DEADLINE: <2026-11-01 Sun>
DEADLINE is when it must be done, SCHEDULED when to start
it, CLOSED when it was done (an inactive timestamp, added by Org). If a
keyword appears twice, the last counts.
Drawers
A drawer hides lines between :NAME: and :END:, each on its
own line (case does not matter for END). Drawers cannot nest.
| Drawer | Content |
|---|---|
:PROPERTIES: | The property drawer: node properties, one per line. It must come directly after the heading and planning line, or at the top of the zeroth section. |
:LOGBOOK: | State changes and notes that Org records, and clock lines. |
| any other name | Anything except headings and other drawers. |
| Node property | Meaning |
|---|---|
:NAME: VALUE | Sets a property. |
:NAME+: VALUE | Adds to a property inherited or set earlier, separated by a space. |
:NAME:, :NAME+: | The same with an empty value. |
Some property names have meanings in Org: ID and
CUSTOM_ID (link targets), CATEGORY,
COLUMNS, EFFORT, ORDERED,
LOGGING, ARCHIVE, VISIBILITY,
NOBLOCKING, STYLE (habit), and
EXPORT_… overrides such as EXPORT_FILE_NAME. Names ending
_ALL list the allowed values of the property without it.
* Lisbon trip
:PROPERTIES:
:ID: 5f0c2b1e-7d3a-4c1b-9b2e-1a2b3c4d5e6f
:EFFORT: 2:00
:END:
Clock lines
CLOCK: [2026-11-12 Thu 09:00]--[2026-11-12 Thu 10:30] => 1:30
records time spent on a task: a start, optionally an end, and the duration in
hours and minutes. An open clock has only the start. Clock lines usually sit in the
LOGBOOK drawer.
Inlinetasks
With the org-inlinetask library loaded, a heading of at least
org-inlinetask-min-level stars (15 by default) is a task inside text
rather than a new section. It may have content, ended by a line of the same stars and
the title END.
The zeroth section
The text before the first heading. It may start with comments and a property drawer that apply to the whole file, followed by in-buffer settings and ordinary content. It cannot have a planning line.
In-buffer settings
Lines of the form #+KEY: VALUE (case-insensitive key) anywhere in the
file, usually at the top, set options for the file. The main keys:
| Key | Meaning |
|---|---|
TITLE, SUBTITLE, AUTHOR, EMAIL, DATE, LANGUAGE, DESCRIPTION, KEYWORDS, CREATOR | Document metadata, used in export. TITLE may repeat and is joined. |
OPTIONS | Export options as key:value pairs, such as toc:2, num:nil, ^:{}, H:3, author:nil. |
STARTUP | How Emacs shows the file: overview, content, showall, indent, hidestars, logdone, inlineimages and so on. |
TODO, SEQ_TODO, TYP_TODO | TODO keywords: #+TODO: TODO WAIT | DONE CANCELLED; states after | are closed. Letters in brackets set quick keys and logging: WAIT(w@/!). |
TAGS, FILETAGS | Allowed tags with quick keys; tags applied to every heading in the file. |
PRIORITIES | Highest, lowest and default priority, such as A C B. |
PROPERTY | A property for the whole file: #+PROPERTY: header-args :results output. |
CATEGORY, ARCHIVE, COLUMNS, CONSTANTS, LINK | Agenda category, archive location, column view format, constants for table formulas, link abbreviations. |
SETUPFILE, INCLUDE | Read settings from another file; include another file’s content at export. |
MACRO | Defines a text macro: #+MACRO: name text with $1. |
BIBLIOGRAPHY, CITE_EXPORT, PRINT_BIBLIOGRAPHY | Citation sources, style and where to print the bibliography. |
EXPORT_FILE_NAME, SELECT_TAGS, EXCLUDE_TAGS | Export target and which subtrees to export. |
HTML_HEAD, LATEX_CLASS, LATEX_HEADER and other BACKEND_… keys | Settings for one export back end. |
A keyword line is an element in its own right; lines like #+NAME: and
#+CAPTION: directly above an element are
affiliated keywords instead.