Introduction

A sandboxed HTML runner provides a secure environment for executing code. The sandbox isolates your code from the rest of the page and your system, ensuring that even malicious or buggy code cannot cause harm beyond the preview panel.

What Is a Sandbox?

In web development, a sandbox is an isolated execution environment. Code running inside a sandbox cannot access resources outside of it — like your cookies, local storage, other browser tabs, or your operating system. Our HTML sandbox uses the HTML5 iframe sandbox attribute to create this isolation.

Security Layers

  • Iframe sandbox attribute — Restricts capabilities of the embedded content
  • Blob URL isolation — Code loads from a temporary Blob URL, not from the main domain
  • No server transmission — Code never leaves your browser
  • Automatic cleanup — Blob URLs are revoked after use

What the Sandbox Allows

  • JavaScript execution (for interactive previews)
  • Modal dialogs (alert, confirm, prompt)
  • CSS rendering (including animations and transitions)
  • Image and media rendering
  • External resource loading (fonts, CDN libraries)

What the Sandbox Blocks

  • Navigation of the parent page
  • Form submissions
  • Pop-up windows
  • Access to parent page cookies or storage
  • Access to other tabs or windows

Learn More

For a detailed technical explanation, read our Methodology page.

Frequently Asked Questions

No. The sandbox isolates the code from the parent page and your browser data.

The sandbox provides significant protection, but no sandbox is perfect. Only run code from sources you trust.

The infinite loop will run inside the sandboxed iframe. You can close the tab or reload the page to stop it.