Run HTML, CSS and JavaScript online
This online HTML editor gives you three files, index.html, style.css and script.js, with a live preview beside them. Type or paste code and the page runs automatically, or press Run (Ctrl/Cmd + Enter) to run it straight away. It does what people look for in an HTML compiler or code runner, although nothing is compiled: your browser renders the HTML, applies the CSS and runs the JavaScript just as it would for a real web page.
A real-time HTML editor with live preview
The preview updates about half a second after you stop typing. Each new version loads in the background and replaces the old one only when it is ready. Switch between responsive, desktop, tablet and mobile widths to check a layout. Open the console for console.log output and JavaScript errors; click a file and line when a location is available.
Test HTML code in a private sandbox
This editor processes your code and saves your draft in your browser. It does not upload your code. The preview blocks links, form submissions, pop-ups, fetch and XMLHttpRequest. HTTPS scripts, stylesheets, images and fonts can still load. Code and libraries you run can send data through those resources, including page contents. Run only code you trust.
How to run an HTML file
- Paste your HTML into index.html, or edit the starter page. Put CSS in style.css and JavaScript in script.js; both are added to the page automatically.
- Watch the preview update as you type, or press Run (Ctrl/Cmd + Enter).
- Open the console to check for errors. Click an error's location to jump to that line.
- Download index.html to get one file with your CSS and JavaScript included. Open it in any browser, or in Phoenix Code to keep building.
Online HTML editor or Phoenix Code?
This page is made for quick experiments and learning. When a page grows into a project, Phoenix Code is a free, open-source code editor for web development. It runs in your browser at web.phcode.dev and as a desktop app for Windows, Mac and Linux.
HTML editor questions
How do I run HTML code online?
Paste your code into index.html. The preview runs it automatically when you stop typing, or you can press Run or Ctrl/Cmd + Enter to run it immediately. CSS in style.css and JavaScript in script.js are added to the page for you.
Is this an HTML compiler?
HTML isn't compiled. People search for an HTML compiler or code runner when they want to see what their code does, and that is what this editor shows: your browser renders the HTML and runs the JavaScript directly. JavaScript errors appear in the console; HTML and CSS are not checked for validity.
Can I use CSS frameworks and JavaScript libraries?
Yes. Link them from an https URL, for example a Bootstrap or Tailwind CDN link in index.html. Network requests made by your own code, such as fetch or XMLHttpRequest, are blocked in the preview.
Is it free, and do I need an account?
It is free and needs no account. This tool does not upload your code. Code and external resources you run can contact other servers and send data. A draft is kept in this browser so you can return to it.
How do I save my code or keep working in Phoenix Code?
Download index.html to save one file with your CSS and JavaScript included, or use Copy all. To continue in Phoenix Code, select Copy code to continue, then Open Phoenix Code after the copy succeeds. Close the welcome screen if shown, open index.html in a project, replace its contents with the copied page, save, and open Live Preview. Your code is not transferred automatically.
What is the best free HTML editor for Windows, Mac or Linux?
The best one is the one that fits how you work. Phoenix Code is a free, open-source HTML editor for Windows, Mac and Linux that also runs in the browser. It is the successor to Adobe Brackets and comes with Live Preview, code hints and Emmet built in.