Railroad / syntax diagram
Native railroad (syntax) diagrams for grammars, json.org style. One production per block — `rule ::= term | other` — with sequences, stacked `|` choices, `[optional]` bypasses, `{repetition}` loops and `(grouping)`. Quoted terminals render as rounded pills, bare nonterminals as rectangles, and every rule in the document renders as its own stacked diagram. The standard way language and API docs explain syntax.
In the same space
Most users come to Railroad / syntax diagram from railroad-diagrams (tabatkins), Hand-drawn EBNF figures or bottlecaps.de/rr. Glyph runs this engine in the browser — no install, shareable via URL, exportable to PNG / SVG / PDF / source.
Syntax at a glance
value ::= object | array | "true" | "false"
object ::= "{" [ pair { "," pair } ] "}"Paste this in the Studio code pane to see Railroad / syntax diagram render live. The full grammar is at the upstream-docs link above.
Sample templates
All 10 →The json.org grammar as stacked railroad diagrams — the canonical example.
Classic expr / term / factor precedence-climbing grammar for calculators and compilers.
SemVer 2.0: major.minor.patch with optional pre-release and build metadata.
Simplified URI grammar: scheme, authority, path, optional query and fragment.
Records, fields, and quoted fields with escaped double quotes.
Calendar date with optional time, seconds, fraction, and timezone designator.
railroad · ← Browse all engines · Quick-start guide