canvas.toDataURL("image/png"); to base64 image code example Example: javascript todataurl var image = new Image(); image.src = canvas.toDataURL();