XCODX |

Pascal Online Compiler & Interpreter

Select Language
Online Code Compiler
Full HTML IDE
Py main.py
Program Output Ready
  Welcome to XCODX Online Compiler

  Quick Start:
  Ctrl+Enter  Run code
  Ctrl+S      Save / Download
  Ctrl+L      Clear output

  Select a language and start coding.
Success
Operation completed

About Pascal

Niklaus Wirth designed Pascal in 1970 to teach structured programming, and it succeeded so thoroughly that a generation of programmers — and much of early Apple software — grew up on it. Turbo Pascal made it the definitive learning language of the 1980s-90s, and its lineage lives on commercially through Delphi and in open source through Free Pascal (the 3.2 series) with the Lazarus IDE; early Skype clients were famously built on Delphi. Pascal remains in classrooms today: several school systems and international olympiad traditions still teach it, prized for readable syntax and strict typing that catches beginner mistakes early. This page compiles Pascal and runs it in a live terminal where readln waits for your genuine keyboard input.

Hello World in Pascal

program InteractiveDemo;
var
  name: string;
  n, i: integer;
  total: int64;
begin
  write('What is your name? ');
  readln(name);
  writeln('Hello, ', name, '!');

  write('Compute the factorial of: ');
  readln(n);

  total := 1;
  for i := 2 to n do
    total := total * i;

  writeln(n, '! = ', total);
  if total mod 2 = 0 then
    writeln('The result is even.')
  else
    writeln('The result is odd.');
end.

When to use Pascal

Pascal remains a set language in secondary-school computing curricula in several countries and a nostalgic-but-real skill for maintaining Delphi codebases, which still run point-of-sale, medical, and industrial software. Students use this page for homework — loops, procedures, records, arrays — without installing Free Pascal, and competitive programmers from olympiad traditions that permitted Pascal can warm up here. It's also a gentle first language for learners who benefit from begin/end blocks and compiler-enforced type discipline before moving to C or Java.

Common questions

Does readln pause for my typed input on this page?

Yes. readln suspends the running program until you enter a line in the terminal, and write output (like a prompt without a newline) is displayed first, so interactive programs behave exactly as in a local console. You can mix readln for strings and numbers across multiple prompts freely.

Which compiler and dialect is used — Turbo Pascal or something newer?

Programs are built with Free Pascal, the actively maintained open-source compiler, which supports classic Turbo Pascal syntax plus Object Pascal extensions and modern types like int64 and dynamic arrays. Textbook Pascal compiles unchanged, and most Delphi-style language features work in the appropriate mode.

Can I build GUI programs or use Delphi units here?

No — this is a console environment, so Lazarus LCL forms and Delphi VCL units aren't available, and execution is a single source file. Standard units that ship with Free Pascal (SysUtils, Math, StrUtils) are usable, which covers essentially all coursework and console-program needs.

How Pascal runs on XCODX

Sandbox filename
main.pas
Entry point
single main source file
Editor grammar
pascal
Reading stdin
ReadLn()
Input delivery
live WebSocket stream
Prompt flushing
flush manually before reading input
Compile limit
10 s
Run limit
3 s batch · up to 3 min live
Memory
256 MB per stage
Max source
50,000 characters

Default program on this page

program Hello;
begin
  writeln('Hello from Pascal!');
  writeln('Welcome to XCODX Online Compiler!');
end.