Hello, World!
-module(main).
-export([start/0]).
start() ->
io:format("Hello, World!~n").Tap Run to execute
main.erl · output appears here
Press Run to execute
Output streams here as your program runs.
Erlang is a functional, concurrent programming language created at Ericsson in 1986 by Joe Armstrong, Robert Virding, and Mike Williams to build highly reliable telephone switching systems. It is built around lightweight processes, message passing, and the actor model, with no shared mutable state. Erlang excels at fault-tolerant, distributed, soft real-time systems and popularized the 'let it crash' philosophy backed by supervision trees.
On CompileBytes, Erlang runs on the BEAM virtual machine via Erlang/OTP, reported as version 23.0.0. OTP (Open Telecom Platform) bundles libraries and design principles for building robust applications. Erlang powers messaging platforms, telecoms, databases, and high-availability backends, and it is known for hot code swapping and the ability to run millions of concurrent processes with very low overhead.
main.erl 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.
-module(main).
-export([start/0]).
start() ->
io:format("Hello, World!~n").-module(main).
-export([start/0]).
square(N) -> N * N.
start() ->
io:format("~p~n", [square(5)]).-module(main).
-export([start/0]).
fact(0) -> 1;
fact(N) when N > 0 -> N * fact(N - 1).
start() ->
io:format("~p~n", [fact(6)]).-module(main).
-export([start/0]).
start() ->
Pid = spawn(fun() -> io:format("Hello from process~n") end),
io:format("Spawned ~p~n", [Pid]).-module(main).
-export([start/0]).
sum([]) -> 0;
sum([H | T]) -> H + sum(T).
start() ->
io:format("~p~n", [sum([1, 2, 3, 4, 5])]).-module(main).
-export([start/0]).
start() ->
Squares = [X * X || X <- [1, 2, 3, 4, 5]],
io:format("~p~n", [Squares]).-module(main).
-export([start/0]).
classify(N) ->
case N of
0 -> zero;
_ when N > 0 -> positive;
_ -> negative
end.
start() ->
io:format("~p~n", [classify(-4)]).-module(main).
-export([start/0]).
area({circle, R}) -> 3.14159 * R * R;
area({rectangle, W, H}) -> W * H.
start() ->
io:format("~p~n", [area({rectangle, 3, 4})]).-module(main).
-export([start/0]).
start() ->
Doubled = lists:map(fun(X) -> X * 2 end, [1, 2, 3]),
Total = lists:foldl(fun(X, Acc) -> X + Acc end, 0, Doubled),
io:format("~p ~p~n", [Doubled, Total]).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
Erlang is one of 46 single-file compiler scratchpads. Each run submits only main.erl; 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 Erlang source file.