HTML CSS JS Live Playground
A CodePen-style front-end playground: three editors, live preview at phone or desktop width, npm imports, a console with eval, ZIP export and share links.
ブラウザ内で動作します。ファイルは端末の外に出ません。 確認方法を見る
…
使い方
- 1Pick a project
Choose a project or create one from a template.
- 2Edit the code
Type in the HTML, CSS and JavaScript editors; Ctrl+Enter runs.
- 3Add packages
Open Packages, add npm names with versions or CDN URLs.
- 4Check the preview
Switch widths and watch the console for logs and errors.
- 5Try code in the console
Type an expression in the console box and press Enter.
- 6Export or share
Use Export ZIP, Single HTML file or Copy share link.
このツールについて
Front-end ideas are fastest to test in a live playground: change a line of CSS, see the page update, check the console. This playground keeps HTML, CSS and JavaScript in three editors next to a sandboxed preview that refreshes as you type. ES modules work out of the box, and npm packages are one form away: add a name and version, and an import map points it at esm.sh, which serves npm packages as browser-ready modules. External stylesheets and classic scripts from a CDN, extra head tags and three layouts cover the usual setups. A console panel collects console.log, warnings, errors and unhandled promise rejections from the preview, groups repeated lines, and lets you run JavaScript inside the page. Projects are saved locally with undo, and export as a ZIP with index.html, style.css and script.js, as a single HTML file, or as a share link.
Who this is for
Front-end developers sketching a component, learners following HTML and CSS courses, teachers preparing live demos, and anyone who needs a quick reproduction of a browser bug to attach to an issue.
Editors and layouts
Editors left with preview right, editors on top in three columns, or tabbed editors for small screens. Ctrl+Enter in any editor runs the preview immediately; with Auto-run on, it refreshes 0.6 seconds after you stop typing. Several projects can be kept and created from templates: a counter in plain JavaScript, confetti from an npm module, and a to-do list with list rendering.
npm packages and libraries
Under Packages, add a package name and an exact version. The playground marks the script as an ES module and adds an import map entry for the package and its sub-paths, so import confetti from "canvas-confetti" just works. External stylesheets and scripts take https URLs, one per line, and the head field takes meta tags or font links.
Preview and console
The preview is an iframe with sandbox allow-scripts, allow-forms, allow-modals and allow-popups but without same-origin access, so code cannot touch this site or your data. Preview widths of 390, 768 and 1024 pixels show phone, tablet and laptop layouts. Open in new tab shows the page full size. The console shows each message with its level, counts repeats and accepts expressions such as document.title.
Export and import
Export ZIP writes index.html linking style.css and script.js, plus a README; Single HTML file inlines everything. Import ZIP or HTML reads a project back, splitting inline styles and scripts from an HTML file into the editors. Copy share link puts the compressed project after # in the address.
Worked example
The counter template has a heading, a number and two buttons. Clicking + three times shows 3 and the console lists count 1, count 2 and count 3. Switching the preview to 390 pixels shows the card still centred, and Export ZIP produces a 4-file project that opens offline.
Limits
Code runs in a sandboxed frame without cookies or storage of this site, so APIs that need a same-origin context, service workers or camera prompts may not work in the preview; use Open in new tab or a local server for those. npm packages must be usable as ES modules in the browser; packages that need Node.js APIs will fail. There is no build step for JSX, TypeScript or SCSS.
計算例
Counter template: three clicks → 3 and console lines count 1–3; Export ZIP → index.html, style.css, script.js, README.md.
ポイント
- カテゴリ: 開発・データ
- ブラウザ内で動作し、登録もアップロードも不要です。
- 入力した情報は端末内にとどまります。
- 英語で利用できます。
- 内容の最終確認日:
- 公式情報源: WHATWG HTML: iframe srcdoc, sandbox and import maps
よくある質問
How do I use an npm package?
Add its name and version under Packages and write import x from "name" in the JavaScript editor; the module is fetched from esm.sh.
Is my code uploaded?
No. The preview is built in your browser; only packages and libraries you add are downloaded from their CDNs.
Why can the preview not read localStorage of this site?
The sandbox keeps the preview on its own opaque origin for safety, so it cannot reach this site's storage or cookies.
Can I run JSX or TypeScript?
Not directly; there is no compile step. Use plain JavaScript modules, or htm with Preact for JSX-like syntax.
How do I continue on another computer?
Copy the share link, export a ZIP, or use Save file and open it on the other computer.
What does Auto-run do?
It rebuilds the preview shortly after you stop typing. Turn it off for heavy pages and press Run when ready.
