Open source · 2026

A code playground whose share links are safe to open

A free HTML, CSS and JavaScript playground with a live preview and console, an HTML viewer, a formatter and an HTML to Markdown converter. The preview runs in a locked sandbox, so even code from a shared link cannot touch the page, drafts or the network.

For
Open source
Role
Design and engineering
Year
2026
Industry
Developer Tools
HTML Playground preview

Overview

A playground that shares code by link is, by design, a way to run a stranger's JavaScript on your screen.

HTML Playground treats that seriously: every run happens in a fresh sandboxed frame with its own security policy, and shared code never runs until you press Run.

The problem

  • Shared playground links run someone else's code.
  • Infinite loops can freeze the tab.
  • Many playgrounds need an account to save or share.

What it had to do

  • Preview code cannot reach the page, its storage, cookies or the network.
  • Share links with no server.
  • A viewer, formatter and converter for everyday HTML jobs.

How I built it

  1. A real sandbox

    Each run gets a new iframe with only allow-scripts, an opaque origin and a CSP that blocks all network access unless the user switches it on.

  2. Trust nothing from the frame

    Console messages are accepted only from the current frame with a random run id, and shown as text, never HTML.

  3. Tested against hostile links

    Reading parent storage, cookies, navigating the top page, opening windows, fetch and image beacons were all tried and all blocked.

What shipped

  • Playground with HTML, CSS and JS tabs, console, Run and Stop, and share links.
  • HTML viewer with scripts off by default.
  • Beautify and minify, and HTML to Markdown.

What came of it

  • Live at html.vivekbhange.tech and open source under the MIT licence.

What it does not do

  • The editors are plain text boxes without syntax highlighting.
  • In Firefox and Safari an infinite loop can still freeze the tab until Stop or reload.

Built with

  • Open Source
  • Astro
  • Security
  • Developer Tools

Useful?

Have something like this to build?

Built by Vivek Bhange, Full-Stack AI Engineer in Pune, India. Open for freelance and collaboration.

Easter egg hunt

This site hides 16 surprises. Found ones stay found on this device. On a phone, type secret words into the command bar (the >_ button).

  1. RickrolledNot found yet

    Show hint

    My photo has a secret. Double-click it (on a phone, press and hold).

  2. Impatient clickerNot found yet

    Show hint

    Click anywhere, fast, about 25 times in a row.

  3. Agent of changeNot found yet

    Show hint

    Type the word that means "make it different".

  4. Gravity checkNot found yet

    Show hint

    Type my first name.

  5. Secret wordNot found yet

    Show hint

    Type something friendly, like "chai" or "namaste".

  6. HackerNot found yet

    Show hint

    Type what hackers do (four letters).

  7. The snapNot found yet

    Show hint

    Type the name of a purple villain who snaps.

  8. Sharp eyesNot found yet

    Show hint

    Something almost invisible floats on the screen. Find it and click it (desktop).

  9. Root accessNot found yet

    Show hint

    Open the command bar (press /, or tap >_ on a phone), then try to become root.

  10. Duck hunterNot found yet

    Show hint

    A rubber duck is hiding on the 3D island.

  11. World travellerNot found yet

    Show hint

    Visit all four views.

  12. Night owlNot found yet

    Show hint

    Come back between midnight and 4 a.m.

  13. Arcade regularNot found yet

    Show hint

    Play every quick game in the Arcade (the ones that open on the Arcade page).

  14. Chain reactorNot found yet

    Show hint

    Set off 30 bursts with a single move in Critical Mass.

  15. Last one standingNot found yet

    Show hint

    Win a match of Drop Zone.

  16. Code whizNot found yet

    Show hint

    Get 10 answers right in a row in Code Clash.

zsh — visitor@vivek: ~

Ask Vivek

Ask me anything. My work, how I run projects, or whether I'm a fit.

AI answers from this site's content. It can make mistakes.