Web Editor — guide & examples
Online web development environment with HTML, CSS, JavaScript, ES modules, TypeScript files, and live browser preview.
About Web Editor
Online web development environment with HTML, CSS, JavaScript, ES modules, TypeScript files, and live browser preview.
Features
- JavaScript Modules
- TypeScript Support
- HTML & CSS
- Local File Imports
- Live Preview
- Code Export
Browser playground limits
- • Code runs in a sandboxed browser preview, without Node.js, a backend, or private environment variables.
- • The Console prompt can inspect browser globals and the rendered DOM, but not variables scoped inside ES modules or component state.
- • Download the project when you need build plugins, server APIs, native modules, or a production dependency workflow.
How to use the Web Editor playground
- Edit a source file from the project explorer — the live preview recompiles automatically.
- Add, rename, duplicate or delete project files as needed. Update affected imports after renaming or moving a file.
- Use the console for logs and errors, and Format to tidy the active file.
- Share the complete project or download a Vite project ZIP with its source files and package.json.
Editing
Select next occurrenceCtrl / ⌘+D
Delete lineCtrl / ⌘+Shift+K
Move line up / downAlt+↑ / ↓
Copy line up / downAlt+Shift+↑ / ↓
Navigation
Go to symbolCtrl / ⌘+Shift+O
Selection
Select all occurrencesCtrl / ⌘+Shift+L
Terminal
Interrupt / kill processCtrl+C
Send EOF (close stdin)Ctrl+D
Console shortcuts
Press Enter to evaluate, ↑ and ↓ to browse command history, and Ctrl/⌘ + L to clear the console.
import { setupCounter } from './modules/counter.js'
import './styles.css'
const button = document.querySelector('[data-counter]')
const output = document.querySelector('[data-count]')
if (!(button instanceof HTMLButtonElement) || !output) {
throw new Error('Counter elements were not found')
}
setupCounter(button, output)
Frequently asked questions
- Is the Web Editor playground free?
- Yes. The Web Editor playground is completely free with no sign-up — write, run and share Web Editor code in your browser.
- Do I need to install anything to run Web Editor online?
- No. The live preview compiles and runs in your browser. After downloading the project, install its dependencies before running it locally.
- Can I share or export my Web Editor code?
- Yes. Share creates a link to your project. Download exports a Vite project ZIP with its source files and package.json.
- Does the editor support autocomplete and live preview?
- It does — a Monaco-powered editor with autocomplete and formatting, a live preview that updates as you type, and a console for logs and errors.
compilebytes.com/tools/web