MaSON
| Filename extension | .mson |
|---|---|
| Internet media type | application/mson |
| Type code | MARKDOWN |
| Uniform Type Identifier (UTI) | public.mson |
| Developed by | Dustin Lee |
| Latest release | 1.0.3 (June 2026) |
| Type of format | Data interchange |
| Extended from | JavaScript |
| Website | github |
MaSON (Markdown Structured Object Notation) is an open-source, ultra-lightweight data serialization language and parser designed to bridge the visual clarity of standard Markdown with the structure of JSON objects. Developed by the software developer Dustin Lee, MaSON was released in June 2026.
The format aims to replace traditional configuration and data interchange formats—such as JSON, YAML, and TOML—in use cases where data must be easily human-authored, edited, or fed into large language models (LLMs).
Background and Rationale
Data serialization formats like JSON are highly machine-readable but are frequently criticized for being difficult to author or edit by hand due to strict punctuation requirements (e.g., missing trailing commas, unquoted keys, or mismatched brackets). While alternative formats like YAML remove bracket-heavy syntax, they introduce fragile spacing and indentation rules. Similarly, TOML can become verbose when managing deeply nested object topologies.
MaSON was designed to eliminate these trade-offs by utilizing standard Markdown syntax (such as headings and bulleted lists) as a structured hierarchy. Because it strips out repetitive structural characters, it drastically reduces character footprints, making it highly token-efficient when injecting structured configurations or data into LLM system prompts.
Features
- Zero-Bracket Nesting: Structure and hierarchy are defined using native Markdown heading syntax (`#`, `##`, `###`) and list structures, completely eliminating curly braces or brackets for object nesting.
- No Spacing Indentation Rules: Unlike YAML, MaSON does not rely on strict multi-space indentation rules, reducing layout-based parsing errors.
- Deterministic Round-Tripping: MaSON provides full bidirectional support, allowing standard JavaScript objects to be cleanly serialized (`stringify()`) and parsed back (`parse()`) without loss of data integrity.
- LLM Token Optimization: By removing repetitive syntax markers like double quotes and brackets, MaSON optimizes prompt space in generative AI applications.
- Embedded Code Block Isolation: The parser natively handles complex edge cases, such as dynamic backtick delimiter matching to isolate embedded code blocks and automated Markdown language tag stripping.
Syntax Example
Instead of writing nested objects via curly braces, MaSON utilizes document flow:
```mson # Server Setup debugMode: false maxRetries: 5 # Servers * [https://api.prod.coolapp.com](https://api.prod.coolapp.com) * [https://api.backup.coolapp.com](https://api.backup.coolapp.com) # Database driver: postgres ## Credentials user: admin host: localhost ```
The underlying TypeScript parser converts the native Markdown line-by-line grammar directly into a standard JavaScript object representation. Explicit complex arrays can be forced via syntax suffixes, such as `# Users[]`.
Implementation
The reference implementation of MaSON is written in TypeScript and is packaged to have a minimal footprint (<2KB gzipped). It features a deterministic grammar layout designed for deployment across both Node.js server environments and edge/browser runtimes.
See also
- Markdown
- JSON
- YAML
- TOML
- Data serialization
External links
This article "MaSON" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:MaSON. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
