Code Sandbox
Modes
Python Text Mode
Python Turtle Mode
Python Graphics Mode
HTML Mode
SVG Mode
Canvas Mode
Docs
Turtle Docs
Graphics Docs
About
Contact
Canvas Sandbox!
Write JavaScript to draw on the canvas below. Click Run to render.
Editor Window
// Example: draw a rectangle and a circle const ctx = canvas.getContext('2d'); ctx.fillStyle = 'orange'; ctx.fillRect(50, 50, 150, 100); ctx.beginPath(); ctx.arc(250, 250, 75, 0, Math.PI * 2); ctx.fillStyle = 'lime'; ctx.fill(); ctx.strokeStyle = 'purple'; ctx.lineWidth = 5; ctx.stroke();
▶ Run
💾 Copy
Clear
Output Window