Hello, World
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
begin
Put_Line ("Hello, World!");
end Main;Tap Run to execute
main.adb · output appears here
Press Run to execute
Output streams here as your program runs.
Ada is a statically typed, structured language designed for reliability, maintainability, and safety-critical systems such as avionics, rail, defense, and space software. It emphasizes strong typing, range and constraint checking, modular packages, and built-in support for concurrency through tasks. Ada's verbose, readable syntax and strict compile-time checks help catch errors early, which is why it is favored in domains where failures are costly.
On CompileBytes, Ada programs are compiled with GNAT, the GNU Ada compiler, reported as version 12.2.0. GNAT is part of the GCC family and implements modern Ada standards. The online environment is well suited to learning the language's package structure, strong typing, and procedure/function declarations, letting you compile and run console programs without installing the GNAT toolchain or GNAT Studio locally.
main.adb 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.
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
begin
Put_Line ("Hello, World!");
end Main;with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
function Square (X : Integer) return Integer is
begin
return X * X;
end Square;
begin
Put_Line (Integer'Image (Square (7)));
end Main;with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
Total : Integer := 0;
begin
for I in 1 .. 5 loop
Total := Total + I;
end loop;
Put_Line ("Sum:" & Integer'Image (Total));
end Main;with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Main is
N : Integer;
begin
Put_Line ("Enter a number:");
Get (N);
Put_Line ("Doubled:" & Integer'Image (N * 2));
end Main;with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
Score : constant Integer := 75;
begin
if Score >= 90 then
Put_Line ("A");
elsif Score >= 70 then
Put_Line ("B");
else
Put_Line ("C");
end if;
end Main;with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
type Int_Array is array (1 .. 5) of Integer;
A : constant Int_Array := (1, 2, 3, 4, 5);
begin
for I in A'Range loop
Put_Line (Integer'Image (A (I) * A (I)));
end loop;
end Main;with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
type Point is record
X : Integer;
Y : Integer;
end record;
P : constant Point := (X => 3, Y => 4);
begin
Put_Line (Integer'Image (P.X) & "," & Integer'Image (P.Y));
end Main;with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
N : Integer := 1;
Fact : Integer := 1;
begin
while N <= 5 loop
Fact := Fact * N;
N := N + 1;
end loop;
Put_Line ("5! =" & Integer'Image (Fact));
end Main;with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
type Day is (Mon, Tue, Wed, Thu, Fri);
D : constant Day := Wed;
begin
Put_Line (Day'Image (D));
Put_Line ("Next:" & Day'Image (Day'Succ (D)));
end Main;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
Ada is one of 46 single-file compiler scratchpads. Each run submits only main.adb; 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 Ada source file.