Home › Blog › How to run JavaScript online
Developer Tools guide

How to run JavaScript online

Try a snippet quickly without opening developer tools. Output from console.log, warn and error appears below the editor.

Open the JavaScript Editor tool

Step by step

  1. Write your code. Type or paste JavaScript. Add HTML if you need elements.
  2. Press Run. Or press Ctrl+Enter. Output appears in the console box.
  3. Copy or download. Copy the code or save it as a file.

Tips for better results

  • Press Run to execute; the code does not run while you type.
  • Add HTML to test DOM code. Scripts see the HTML you provide.
  • Avoid endless loops; they can freeze this tab.

Limits to know

  • Formats: JavaScript and HTML
  • Size: Limited by browser memory
  • Notes: Runs in a sandboxed frame. An endless loop can freeze the tab; close or reload the page if that happens.

At a glance

ToolJavaScript Editor
CategoryDeveloper Tools
Works withJavaScript and HTML
Size limitLimited by browser memory
Where it runsIn your browser tab; your input is not uploaded
CostFree, no sign-up

Frequently asked questions

Where does the code run?

In an isolated, sandboxed frame inside your browser. It cannot read this site, cookies or your files.

Can I use fetch?

Network requests from the frame are limited by the browser sandbox and may fail.

If something does not work

  • The result is empty. Check that you typed or pasted text into the input box and that the options are not hiding everything.
  • The page feels slow. Very large text slows any browser tool. Work on smaller parts.
  • Characters look wrong. Make sure the text is saved as UTF-8 in the program you copied it from.
  • Copy does not work. Some browsers block automatic copying; select the result and copy it yourself.

Still stuck? Use Report a Problem and tell us the tool, your browser and what happened, or read the Help Center.

Related tools and guides

More tools like this are in Developer Tools, or browse all tools.