MRTD Quick Start

MRTD is a tabular format.

The first row is the header. Every later row is data. Cells are separated by whitespace rather than commas.

Basic example

name:string age:int active:bool
Ada 32 true
"Rena Holm" 29 false

Header cells

Each header cell is either:

  • a field name

  • or a field name with a type annotation like name:string

The current core draft supports only these scalar types:

  • int

  • float

  • bool

  • string

Quoted names and values

Identifiers can be written without quotes:

name city
Ada Oslo

Anything that is not a valid identifier should be quoted:

"full name":string city:string
"Rena Holm" "Bergen sentrum"

Multiline rows

Rows can be wrapped in round brackets when they need to span multiple lines:

name:string note:string score:float
( "Rena Holm"
  "line wrapped"
  13.5 )

Profiles

The MRTD core does not include suffix extensions. If an implementation supports extra suffixes, they should be exposed through named profiles rather than being accepted silently in core mode.

The current profile experiment is extended-scalars. That profile allows examples such as:

when bonus
"2026-04-03"dt 3k

Profile activation is intended to be composable. An implementation may enable more than one named profile at once.

Implementation examples

Makrell#

var rows = MrtdTyped.ReadRecords<Person>(
    """
    name:string age:int active:bool
    Ada 32 true
    Ben 41 false
    """);
var doc = MrtdParser.ParseSource(
    """
    when bonus
    "2026-04-03"dt 3k
    """,
    new MrtdParseOptions
    {
        Profiles = new HashSet<string>(StringComparer.Ordinal)
        {
            MrtdProfiles.ExtendedScalars,
        },
    });

MakrellPy

from makrell.mrtd import read_records

rows = read_records("""
name:string age:int active:bool
Ada 32 true
Ben 41 false
""")
doc = parse_src("""
when bonus
"2026-04-03"dt 3k
""", profiles=("extended-scalars",))

MakrellTS

import { parseMrtd, readMrtdRecords } from "makrellts";

const rows = readMrtdRecords(`
name:string age:int active:bool
Ada 32 true
Ben 41 false
`);
const doc = parseMrtd(`
when bonus
"2026-04-03"dt 3k
`, { profiles: ["extended-scalars"] });

Where to go next

  • the current draft spec in specs/mrtd-spec.md

  • Implementation Matrix

  • the MakrellPy, MakrellTS, and Makrell# implementation sections