Get to know MDN better
Since December 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The toJSON() method of the PerformanceEventTiming interface is a serializer; it returns a JSON representation of the PerformanceEventTiming object.
None.
A JSON object that is the serialization of the PerformanceEventTiming object.
The JSON doesn't contain the target property because it is of type Node, which doesn't provide a toJSON() operation.
In this example, calling entry.toJSON() returns a JSON representation of the PerformanceEventTiming object.
This would log a JSON object like so:
To get a JSON string, you can use JSON.stringify(entry) directly; it will call toJSON() automatically.
| Event Timing API # dom-performanceeventtiming-tojson |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 7, 2023 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.