JSON Forge
100% Client-Side: your data is never sent to a server

JSON examples

Order and Invoice JSON Example

An order with a customer, line items and totals. Amounts are integers in cents, which avoids floating-point rounding errors.

Loading editor…
Paste or type JSON on the left to explore it as a tree.
Empty🔒 Processed locally in your browser

The example

The JSON above is the example. Explore it in the Tree tab, press Download to save it as a .json file, or Share to send someone a link to it. All names, ids, emails and values are invented.

Fields explained

PathTypeNotes
orderIdstringA readable identifier. Strings avoid precision problems with long numbers.
statusstringOne of a small set of values such as pending, paid or shipped.
items[].unitPriceCentsnumberPrice in the smallest currency unit, an integer.
totalsobjectComputed amounts, also in cents. totalCents = subtotal + shipping + tax.
placedAtstringISO 8601 UTC timestamp.

Read it in code

JavaScript:

const total = data.items.reduce((sum, i) => sum + i.quantity * i.unitPriceCents, 0); // 3290

Python:

total = sum(i["quantity"] * i["unitPriceCents"] for i in data["items"])  # 3290

What this example is good for

Tips

Convert this example

Open it in a converter, then switch the output in the Code tab:

More examples

All JSON examples · Cheat sheets