This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The DOMMatrix constructor creates a new DOMMatrix object which represents 4x4 matrices, suitable for 2D and 3D operations..


var domMatrix = new DOMMatrix([init])


init Optional
Either a string containing a sequence of numbers or an array of integers specifying the matrix you want to create.


This example creates a DOMMatrix to use as an argument for calling Point.matrixTransform().

var point = new DOMPoint(5, 4);
var matrix = new DOMMatrix([2, 0, 0, 2, 10, 10]);
var transformedPoint = point.matrixTransform(matrix);


Specification Status Comment
Geometry Interfaces Module Level 1
The definition of 'DOMMatrix' in that specification.
Candidate Recommendation Initial definition.

Browser Compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 61 ? ? 48 ?
Available on Web workers 61 ? ? 48 ?
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support 61 61 ? ? ? 48 ?
Available on Web workers 61 61 ? ? ? 48 ?

Document Tags and Contributors

Contributors to this page: jpmedley
Last updated by: jpmedley,