Newly availableRelevant for specialized parsing and data integrity work. Most apps can continue using ordinary JSON parsing.

Overview

JSON source text access preserves the original JSON token text during parsing. It is useful when precision or exact source representation matters more than normal JSON value conversion alone.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
114
114
135
18.4
114
18.4
Built-in object

If a reviver is specified, the value computed by parsing is transformed before being returned. Specifically, the computed value and all its properties (in a depth-first fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the reviver.

114
114
135
18.4
114
18.4

The JSON.rawJSON() static method creates a "raw JSON" object containing a piece of JSON text. When serialized to JSON, the raw JSON object is treated as if it is already a piece of JSON. This text is required to be valid JSON.

114
114
135
18.4
114
18.4
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

JAVASCRIPT
JSON.parse('{"big": 12345678901234567890}', (key, value, { source }) => {
  if (key === 'big') return BigInt(source);
  return value;
});

Live demo

Check JSON.rawJSON support

Detect the API and fall back when the runtime does not support it yet.

JavaScript
Output
Press the Run button

Embed pre-serialized JSON

Insert a prebuilt JSON fragment without double-encoding it.

JavaScript
Output
Press the Run button

Compare with a normal string

See the difference between raw JSON insertion and a plain string field.

JavaScript
Output
Press the Run button

Use cases

  • Precision-sensitive numbers

    Retain the exact numeric source text when downstream logic must avoid precision loss.

  • Audit-friendly parsing

    Compare parsed values with the original token text when traceability matters.

Cautions

  • This is a niche parsing feature, so avoid it unless exact source preservation solves a real problem.
  • Extra parsing complexity is rarely justified for everyday configuration or API payloads.

Accessibility

  • No direct accessibility effect, but reliable data handling supports accurate user-facing output.
  • Keep specialized parsing code well documented so future contributors can maintain it confidently.

Powered by web-features