Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
The toString() stringifier of the DOMMatrixReadOnly interface returns the value of the matrix as a string in the form of a matrix() or matrix3d() CSS transform function; comma-separated lists of 6 or 16 coordinate values, prepended by "matrix( or "matrix3d( respectively, appended by )".
For a 2D matrix, the elements a through f are listed, for a total of six values and the form matrix(a, b, c, d, e, f). See the matrix() CSS function for details on this syntax.
For a 3D matrix, the returned string contains all 16 elements and takes the form matrix3d(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44). See the CSS matrix3d() function for details on the 3D notation's syntax.
None.
A string; the values of the list separated by commas, within matrix() or matrix3d() function syntax.
| Geometry Interfaces Module Level 1 # dommatrixreadonly-stringification-behavior |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Nov 6, 2025 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.