Online JavaScript Editor and Console
Write JavaScript, run it in a sandbox and see console output and errors. Optional HTML lets you work with the DOM.
How to use JavaScript Editor
Step by step
Write your code
Type or paste JavaScript. Add HTML if you need elements.
Press Run
Or press Ctrl+Enter. Output appears in the console box.
Copy or download
Copy the code or save it as a file.
Features and benefits
What you get
Live preview
Your page is shown in a sandboxed frame.
Sandboxed
The preview cannot read this site or your files; it runs in an isolated frame.
Format with one click
Tidy your code using the built-in formatter.
No sign-up
Open the page and start.
Supported formats and limitations
What to expect
Supported formats
JavaScript and HTML
Size limits
Limited by browser memory
Limitations
Runs in a sandboxed frame. An endless loop can freeze the tab; close or reload the page if that happens.
Frequently asked questions
Quick answers
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.
Related tools
More from Developer Tools
JSON Formatter
Format, indent, sort and minify JSON. Invalid JSON is reported with the line and column of the problem.
JSON Validator
Check whether your JSON is valid. If it is not, see the exact line and column and a plain-English reason.
HTML Formatter
Indent and tidy HTML. Inline tags stay on the line, and embedded CSS and JavaScript are formatted too.
Related guides
Read more about this tool