coderef

JSON source text accessBaseline · Newly available

To serialize and parse JSON in a lossless way, JSON.stringify() handles rawJSON values and JSON.parse()'s reviver callback takes a source context parameter.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Mar 31, 2025.

Browser support

DesktopChrome
1–113Not supported
114+Supportedsince May 30, 2023
Current: 155
Edge
12–113Not supported
114+Supportedsince Jun 2, 2023
Current: 154
Firefox
1–134Not supported
135+Supportedsince Feb 4, 2025
Current: 157
Safari
1–18.3Not supported
18.4+Supportedsince Mar 31, 2025
Current: 27
MobileChrome Android
18–113Not supported
114+Supportedsince May 30, 2023
Current: 155
Firefox Android
4–134Not supported
135+Supportedsince Feb 4, 2025
Current: 157
Safari iOS
1–18.3Not supported
18.4+Supportedsince Mar 31, 2025
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Mar 31, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: isRawJSON.

Feature detection

JS · check before using
if ("isRawJSON" in JSON || ("prototype" in JSON && "isRawJSON" in JSON.prototype)) {
  // JSON.isRawJSON is available
}

Sub-features

Support for each part of the feature (3). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
JSON.isRawJSON11411413518.411413518.4
JSON.parse.reviver_parameter_context_argument11411413518.411413518.4
JSON.rawJSON11411413518.411413518.4