Skip to content

Online Compiler

Run JavaScript and Python snippets in your browser, or preview HTML and CSS. Review the mode limits below before running code.

Processes in your browser · How your data is handled

JavaScript and Python execute in workers, without page DOM access. Execution stops after five seconds; Python runtime loading has a separate 30-second limit and downloads Pyodide from jsDelivr. Workers can access network and some origin storage APIs; this is not a security sandbox. Run only code you trust. TypeScript is not transpiled.

22 lines
code.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Output
Click "Run" or press Ctrl+Enter to execute your code...
Ctrl+EnterRun codeTabIndent
7 languages
Browser-based execution

About the Online Compiler

Use this browser scratchpad to try a short JavaScript or Python snippet, inspect console output, or preview HTML and CSS. It is useful for checking a calculation or isolating a small example before moving it into your project.

JavaScript and Python execute in dedicated workers without access to the page DOM. Python runs through Pyodide, which downloads a browser runtime on first use. The runner does not upload your source to an execution server, but the code you run can itself access browser capabilities and make network requests.

What each editor mode actually does

JavaScript evaluates the current text and captures supported console calls. Python executes through Pyodide and captures standard output and errors. HTML and CSS create a browser preview.

The TypeScript editor currently passes its contents to the JavaScript evaluator without a transpilation step. JavaScript-compatible syntax can run, but type annotations, interfaces and other TypeScript-only syntax fail. Use a TypeScript compiler or your project's build for typed code.

JSON and Markdown appear in the mode list, but they do not provide the dedicated formatter and Markdown renderer available elsewhere on UtilByte. Use those tools for strict JSON validation or rendered Markdown.

Local execution does not mean isolated execution

Workers cannot access the page DOM or localStorage, but can use network and some origin storage APIs. Python also has a virtual filesystem and browser bridge. Worker execution is not a security sandbox for untrusted code.

Run only code you understand, using synthetic data. Do not include passwords, production credentials or sensitive documents. HTML and CSS previews run in a sandboxed iframe. Remote images can contact their hosts. Inline event attributes are blocked by CSP; attach listeners from a script element. Network requests, forms and nested frames are blocked in the preview.

A worker is terminated after five seconds of execution. Python has a separate 30-second runtime loading limit. Stop cancels a pending run, and switching languages discards its results. Large allocations can still strain the browser; keep examples small.

Console output and asynchronous work

For JavaScript, the tool reads captured console output shortly after the synchronous function returns. Output from timers or promises that settle later may be missing. It does not wait for every asynchronous operation to finish.

Python uses Pyodide's asynchronous execution method. Runtime downloads, package availability and browser restrictions can affect what a Python snippet can do. A server or desktop Python environment may behave differently.

When to move to a project environment

Use your own editor and runtime for package-based projects, Node APIs, TypeScript builds, debugging across files or code you intend to keep. This page does not manage npm dependencies or reproduce a production environment.

Treat the displayed duration as feedback about this run, not a benchmark. Browser scheduling, runtime initialization and other tabs affect the result.

Illustrative example

A JavaScript numeric sort

Input
const values = [1, 10, 2, 20, 3];
console.log(values.sort((a, b) => a - b));
Output
[
  1,
  2,
  3,
  10,
  20
]

The numeric comparator sorts by the difference between values. Without it, JavaScript's default array sort compares string representations. The console formats this array as indented JSON.

What this tool will not do

  • TypeScript type syntax is not transpiled. The TypeScript mode currently has the same evaluator as JavaScript.
  • Code runs in workers, separate from the page DOM. Workers can still make network requests and use some origin storage APIs. Run only trusted code.
  • Python needs the Pyodide download on first use. A cold cache or failed download prevents execution until the runtime loads.
  • Execution is limited to five seconds after runtime initialization. Python loading is limited to 30 seconds; these limits do not cap memory use.
  • Late asynchronous JavaScript console output may not be displayed.
  • Code is not saved by this tool. Keep a separate copy before refreshing, switching modes or closing the tab.

Frequently Asked Questions

What languages are supported?

JavaScript runs directly and Python runs through Pyodide. HTML and CSS have previews. TypeScript mode currently uses the JavaScript evaluator without transpiling type syntax. JSON and Markdown are editor modes with limited preview behavior.

Is Python execution real?

Yes. Python runs using Pyodide, a full CPython interpreter compiled to WebAssembly. It supports most Python standard library features including math, json, re, collections, itertools, and more.

Are my files uploaded anywhere?

The runner does not submit your code to an execution server. Python downloads its runtime from jsDelivr. Code you run can access browser capabilities and make network requests; preview content can also load external resources. Do not run untrusted code or include secrets.

What are the limitations?

JavaScript and Python run in workers without access to the page DOM. Execution is stopped after five seconds, with a separate 30-second Python runtime loading limit. Workers can still access network and some origin storage APIs: run only code you trust. TypeScript syntax is not transpiled.

Can I use keyboard shortcuts?

Yes. Press Ctrl+Enter (or Cmd+Enter on Mac) to run your code. Tab inserts 2 spaces for indentation.

Why does Python take a moment to load?

Python downloads the Pyodide runtime from jsDelivr on first use. Download time and later cache reuse depend on your connection and browser. Additional Python packages can require further downloads.