Hello World
console.log("Hello, World!");Tap Run to execute
main.js · output appears here
Press Run to execute
Output streams here as your program runs.
Deno is a secure, modern runtime for JavaScript and TypeScript created by Ryan Dahl, the original author of Node.js, who announced it in 2018 and released version 1.0 in 2020. Built in Rust on top of the V8 engine, it executes TypeScript natively without a separate build step and embraces web-platform standards such as fetch, Web Workers, and ES modules.
Deno is secure by default: scripts run in a sandbox and must be granted explicit permissions for file, network, or environment access. The 2.x line restored full backward compatibility with Node.js and npm packages while keeping a single executable that bundles a formatter, linter, test runner, and the JSR package registry. It is used for web servers, CLI tools, scripting, and edge functions.
main.js is the entry point. Add helper files from the explorer and import them into your project.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
main.js uses Deno’s explicit local-module extension.
import { answer } from "./helper.js";
console.log(answer());
export const answer = () => 42;
console.log("Hello, World!");const buf = new Uint8Array(1024);
const n = await Deno.stdin.read(buf);
const name = new TextDecoder().decode(buf.subarray(0, n ?? 0)).trim();
console.log(`Hello, ${name}!`);const fruits = ["apple", "banana", "cherry"];
for (const [i, fruit] of fruits.entries()) {
console.log(`${i + 1}: ${fruit}`);
}function add(a: number, b: number): number {
return a + b;
}
console.log(add(2, 3));interface User {
id: number;
name: string;
}
const users: User[] = [
{ id: 1, name: "Alice" },
{ id: 2, name: "Bob" },
];
for (const u of users) {
console.log(`${u.id}: ${u.name}`);
}const nums = [1, 2, 3, 4, 5];
const doubled = nums.map((n) => n * 2);
const evens = nums.filter((n) => n % 2 === 0);
const sum = nums.reduce((acc, n) => acc + n, 0);
console.log(doubled, evens, sum);async function fetchData(): Promise<string> {
return await Promise.resolve("done");
}
try {
const result = await fetchData();
console.log(result);
} catch (err) {
console.error("Error:", err);
}const ages = new Map<string, number>([
["alice", 30],
["bob", 25],
]);
ages.set("carol", 28);
for (const [name, age] of ages) {
console.log(`${name} is ${age}`);
}
const unique = new Set([1, 2, 2, 3]);
console.log([...unique]);class Stack<T> {
private items: T[] = [];
push(item: T): void {
this.items.push(item);
}
pop(): T | undefined {
return this.items.pop();
}
get size(): number {
return this.items.length;
}
}
const s = new Stack<number>();
s.push(1);
s.push(2);
console.log(s.pop(), s.size);type Shape =
| { kind: "circle"; r: number }
| { kind: "rect"; w: number; h: number };
function area(s: Shape): number {
switch (s.kind) {
case "circle":
return Math.PI * s.r ** 2;
case "rect":
return s.w * s.h;
}
}
console.log(area({ kind: "circle", r: 2 }).toFixed(2));
console.log(area({ kind: "rect", w: 3, h: 4 }));The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Type or paste your code into the editor, then click Run (or press Ctrl/Cmd + Enter) to execute it.
Output streams into the console panel, including runtime errors, exit status, and execution time.
Nothing to install and no account to create — code runs in an isolated hosted runtime.
Language-aware autocomplete and IntelliSense suggestions where the editor has a matching language service
Syntax highlighting, with native compiler and runtime errors shown in the console
Bracket matching, auto-indentation, code folding, and a minimap
Multi-cursor editing plus find & replace (Ctrl/Cmd + F)
Full undo/redo history and copy to clipboard
Built on Monaco — the same editor that powers VS Code
Run on demand, or turn on Auto-run to execute on every change
Stop long-running or infinite programs at any time
A real console shows standard output, errors, exit status, and execution time
Pass standard input (stdin) to your program from the Input panel — one value per line
Switch between light and dark themes
Adjust font size and other editor settings
Toggle side-by-side or top/bottom layouts
Enter distraction-free fullscreen mode
Generate a shareable link to your exact code in one click — no login needed
Your work autosaves to your browser, so you can pick up where you left off
Copy the active file to your clipboard
Run code: Ctrl/Cmd + Enter
Find & replace: Ctrl/Cmd + F
Open the full shortcut list from the keyboard icon in the toolbar
Deno is one of 23 linked-project compilers. Run always starts main.js; selecting a helper tab changes what you edit, not the entry file.
main.js uses Deno’s explicit local-module extension.
Linked-project languages (23): Node.js, TypeScript, Deno, Python, C, Go, Dart, Swift, Rust, Ruby, PHP, Java, Kotlin, C++, C#, Nim, Crystal, Haxe, Zig, Scala, D, Bun, Objective-C.
Single-file scratchpads (46): Matplotlib, NumPy, pandas, Haskell, Clojure, Perl, Lua, Tcl, jq, Raku, Elixir, Bash, Zsh, Nushell, R, Assembly (NASM), Julia, Octave, Groovy, PowerShell, Visual Basic .NET, Odin, Pascal, Lisp, Erlang, CoffeeScript, COBOL, BASIC, V, Racket, OCaml, Prolog, AWK, Emacs Lisp, Emojicode, Forth, F#, Fortran, Assembly (NASM64), Solidity, Mojo, Ada, WASM (WAT), Gleam, Shell Script (sh), Scheme. Their extra project files are not submitted to the runtime.
Download project exports every Deno tab and a README in one ZIP archive.