Text & Developer tool

Online HTML, CSS and JavaScript Editor

Write HTML, CSS and JavaScript and see the result live, with a console.

  • Instant results
  • Working shown
  • No sign-up
  • Runs in your browser
ToolUpdates as you type
Preview
Console
console.log output and errors appear here.

Your code runs only in your browser, inside a locked-down frame. Nothing is uploaded or saved, so copy your work before you leave. Press Tab to indent.

How it works

This online HTML, CSS and JS editor has three panes, one for each language, and a live preview that updates as you type. console.log output and errors show in a console panel below. Your code runs in a sandboxed frame inside your own browser, and Reset brings back the starter template.

This online HTML, CSS and JavaScript editor lets you write web code and see the result at once. Type HTML, CSS and JavaScript in separate panes, watch the live preview, and read console.log output underneath. It is a quick playground for practice, homework and interview prep.

How to use the web code editor

  1. Start with the template. It has a heading, a paragraph and a button that counts clicks.
  2. Edit the HTML, CSS or JavaScript pane. On a phone, switch panes with the tabs.
  3. The preview updates about half a second after you stop typing. Untick Auto-run to update only when you click Run.
  4. Check the Console for console.log output and error messages.
  5. Click Reset to starter to go back to the template.

Press Tab inside a pane to indent by two spaces.

How the preview is built

The editor joins your three panes into one web page:

<!DOCTYPE html>
<html>
  <head>
    <style>/* your CSS */</style>
  </head>
  <body>
    <!-- your HTML -->
    <script>/* your JavaScript */</script>
  </body>
</html>

Your JavaScript runs after your HTML, so document.getElementById can find your elements without waiting for a load event.

Common mistake: A common mistake beginners make is writing a full page, with <html> and <head> tags, inside the HTML pane. Put only what belongs inside <body> there. Styles go in the CSS pane and scripts go in the JavaScript pane.

Safe by design

The preview runs inside an <iframe> with the sandbox="allow-scripts" setting. That means:

  • Your JavaScript can run and change the preview.
  • It cannot read this site's cookies or storage, or change this page.
  • It cannot open pop-ups or submit forms to other sites.
  • alert(), confirm() and prompt() boxes are blocked, so use console.log or change the page text instead.

Nothing you type is sent to a server. The page itself works fully in your browser.

Things to try

Try this Where What you learn
Change h1 { color: ... } to another colour CSS Selectors and properties
Add display: flex; gap: 1rem; to a wrapper CSS Flexbox layout
Add console.log(document.title) JavaScript Using the console
Add an <input> and show its value on click HTML and JavaScript DOM events
Misspell a variable on purpose JavaScript Reading error messages

Learn as you practise

Pro tip: When something does not work, add console.log lines step by step. Seeing which line runs, and with which values, finds most bugs faster than rereading the code.

Frequently asked questions

Do I need to install anything to run HTML online?
No. The editor works in any modern browser on a laptop or phone. There is nothing to install and no account to create.
Where does console.log output go?
To the Console panel under the preview. Errors, such as a misspelt variable name, also appear there with the line number when the browser gives one.
Is my code saved?
No. Nothing is uploaded or stored, so your code is gone if you close or reload the page. Copy it into a file on your computer to keep it.
Can I use libraries like Bootstrap or jQuery?
The editor does not load any library for you. The preview may load a script or stylesheet tag you add yourself if your network allows it, but for learning, plain HTML, CSS and JavaScript work best.
Is it safe to paste code from the internet?
The preview runs in a sandboxed frame that cannot read this website's data, cookies or storage. Still, only run code you understand, and do not paste passwords or keys into it.

Try another tool

See all free tools
Chat with us