The notation for what's next

Mark is a unified notation for both object and markup data, combining the best of JSON, HTML, and XML with a clean syntax and succinct data model.

Open Source JS-friendly Cross-platform
mark-example.mk
<form                                 // element with name 'form'
  <div class:'form-group'             // nested child element
    <label for:email                  // 'for' and its value, both unquoted
      "Email address:"                // text needs to be double quoted
    >
    <input type:email, id:email>      // element without child
  >
  <div class:'form-group'             // 'form-group' is a quoted symbol
    <label for:pwd; "Password">       // pwd is an unquoted symbol
    <input type:password, id:pwd>     // attrs separated by comma, like JSON
  >
  <button class:[btn,'btn-info']      // attribute with complex values
    "Submit"                          // comment like in JS!
  >
>

Why Mark Notation?

Mark combines the best features from popular data formats while eliminating their limitations.

Clean Syntax

Enjoy a fully-typed data model with clean, readable syntax that's more human-friendly than JSON or XML.

Mixed Content Support

Built-in support for mixed content, making it perfect for document-oriented data that's awkward in JSON.

Generic & Extensible

Unlike HTML's specialized format, Mark is generic and extensible for any data representation needs.

Type Safety

Every Mark object has a type name, eliminating the anonymous object problem that exists in JSON.

No Whitespace Ambiguity

Text objects are explicitly quoted, so Mark can be minified or prettified without changing content.

JavaScript-Friendly

Maps directly to plain JavaScript objects, making it ideal for web and Node.js environments.

See the Difference

Compare the same data structure in different formats.

Mark Notation
<form
  <'!--'comment>
  <div class:'form-group'
    <label for:email "Email address:">
    <input type:email, id:email>
  >
  <div class:'form-group'
    <label for:pwd; "Password">
    <input type:password, id:pwd>
  >
  <button class:[btn, 'btn-info'] "Submit">
>
JSON
{
  "type": "form",
  "children": [
    {
      "type": "div",
      "class": "form-group",
      "children": [
        {
          "type": "label",
          "for": "email",
          "children": ["Email address:"]
        },
        {
          "type": "input",
          "type": "email",
          "id": "email"
        }
      ]
    }
  ]
}
HTML
<form>
  <!--comment-->
  <div class="form-group">
    <label for="email">Email address:</label>
    <input type="email" id="email">
  </div>
  <div class="form-group">
    <label for="pwd">Password</label>
    <input type="password" id="pwd">
  </div>
  <button class="btn btn-info">Submit</button>
</form>
XML
<form>
  <!--comment-->
  <div class="form-group">
    <label for="email">Email address:</label>
    <input type="email" id="email"/>
  </div>
  <div class="form-group">
    <label for="pwd">Password</label>
    <input type="password" id="pwd"/>
  </div>
  <button class="btn btn-info">Submit</button>
</form>

Get Started with Mark

Start using Mark Notation in your projects today.

Install via npm
npm install mark-js --save

Usage in Node.js
const Mark = require('mark-js');
var obj = Mark.parse(`<div <span "Hello World!">>`);
console.log("Greeting from Mark: " + Mark.stringify(obj));
Download and include
<script src='dist/mark.js'></script>
<script>
var obj = Mark(`<div <span "Hello World!">>`);  // using a shorthand
console.log("Greeting from Mark: " + Mark.stringify(obj));
</script>
Include from CDN
<script src='https://cdn.jsdelivr.net/npm/mark-js@1.0.0/dist/mark.js'></script>
<script>
var obj = Mark(`<div <span "Hello World!">>`);  // using a shorthand
console.log("Greeting from Mark: " + Mark.stringify(obj));
</script>

Documentation & Resources

Everything you need to master Mark Notation.

Syntax Specification

Complete syntax reference with examples and best practices.

Read the spec →

API Reference

Detailed API documentation for all mark.js functions and methods.

View API docs →

FAQ

Frequently asked questions about Mark Notation and its usage.

Read FAQ →

Examples

Live examples and interactive demonstrations of Mark features.

Try examples →