HTML Tutorial

The language for building web pages.

HTML Canvas

HTML Canvas

The HTML <canvas> element is used to draw graphics on a web page via JavaScript. The canvas element is only a container for graphics — you must use JavaScript to actually draw.

Canvas Can Draw:

  • Shapes (rectangles, circles, lines)
  • Text
  • Images
  • Animations
  • Games
  • Data Visualizations

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics