Back to resources

Formula Schema

Schemas & Deep Dives Reference Updated Feb 1, 2025

Share

Overview

This page documents the JSON format for Saved Formulas so your files can be validated and shared between devices or tools. For a practical walkthrough of saving, loading, importing, and exporting formulas from the UI, see Saving and Managing Dice Formulas.

Plain English: You don’t need to know code to use this. “JSON” is just a structured text file the app reads and writes, and the “schema” is a rulebook for tools to double‑check that a file looks right. Most players can ignore the details below.

Downloads

See the Downloads section at the bottom of this page for files.

Important: For now, do not rename the file. The app expects the filename to be saved_formulas.json. (Dice Bags will later allow custom names.)

Format (canonical)

Saved Formulas are stored as a wrapped object:

  • formulas (array): The list of saved formulas.
  • version (string, optional): File version you maintain for your own tracking.
  • schemaVersion (number): Format version used by the app (e.g., 1).

Formula object fields

  • formula (required string): Dice expression, non-empty.
  • name (optional string): Display label; defaults to formula if missing.
  • description (optional string): Extra context.
  • dateAdded (optional ISO8601 string): Timestamp when created.
  • id (optional string): Unique identifier (usually generated by the app).

Minimal skeleton

{
  "formulas": [
    { "formula": "2d6+3", "name": "Sword attack" }
  ],
  "schemaVersion": 1
}

Compatibility

  • Imports accept older shapes (a top-level array or a single formula object). The app normalizes to the wrapped format shown above when exporting.

Downloads