Hello, World
disp("Hello, World!")Tap Run to execute
main.m · output appears here
Press Run to execute
Output streams here as your program runs.
Octave (GNU Octave) is a high-level programming language for numerical computing, created by John W. Eaton and first released in 1994. It is largely compatible with MATLAB, using the same matrix-first syntax, and is widely used for linear algebra, signal processing, statistics, and quickly prototyping numerical algorithms.
This online compiler runs GNU Octave 8.1, so you can write and run Octave (and most MATLAB-style) scripts in an isolated hosted runtime without installing anything. It is free and open source, which makes it a popular no-cost alternative for students and engineers who need MATLAB-compatible scripting.
main.m is the entry point for each run.
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.
disp("Hello, World!")A = [1 2; 3 4];
b = A * [1; 1];
disp(b)for i = 1:5
printf("%d\n", i);
endfunction y = square(x)
y = x .^ 2;
endfunction
disp(square(4))v = 1:5;
squares = v .^ 2;
printf("sum of squares: %d\n", sum(squares));
printf("mean: %.1f\n", mean(v));x = -3;
if x > 0
disp("positive")
elseif x < 0
disp("negative")
else
disp("zero")
endA = [2 1; 1 3];
b = [3; 5];
x = A \ b; % solve A*x = b
disp(x)n = 5;
fact = 1;
while n > 1
fact = fact * n;
n = n - 1;
end
printf("5! = %d\n", fact);v = [4 -2 7 -1 3];
positives = v(v > 0);
disp(positives)
printf("count: %d\n", numel(positives));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
Octave is one of 46 single-file compiler scratchpads. Each run submits only main.m; local sibling-file imports are not enabled.
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.
Download file exports the active Octave source file.