Online Pascal Compiler
Compile and run Pascal online with Free Pascal 3.2. Write your program, press Run, and fpc compiles it and starts it, with errors and warnings shown by line and column if the build fails. Programs can read input with ReadLn as they run, and Turbo Pascal and Delphi code compiles in its own mode.
How to run Pascal code online
- This page opens with Pascal selected, so you can start typing straight away.
- Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
- Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
- Share a copy with a link, or save your files to your computer.
Free Pascal 3.2 on Online IDE
- Your program is compiled with Free Pascal (fpc -O2) and starts as soon as the build succeeds.
- Compiler errors and warnings show the file, line and column, as in main.pas(12,5).
- ReadLn reads a line of input, and text from Write appears straight away, so a prompt shows before the program waits.
- Start the file with {$mode objfpc}{$H+} or {$mode delphi} for classes, exceptions, long strings and a 32-bit Integer.
Example: a Pascal program that reads input
program Main;
{$mode objfpc}{$H+}
uses
SysUtils;
var
Line: string;
N, I: Integer;
Total: Int64;
begin
Write('Add up the whole numbers from 1 to: ');
ReadLn(Line);
if not TryStrToInt(Trim(Line), N) then
WriteLn('That is not a whole number.')
else
begin
Total := 0;
for I := 1 to N do
Total := Total + I;
WriteLn('1 + 2 + ... + ', N, ' = ', Total);
end;
end.
Features of this tool
- Simple and fastA clean, lightweight editor that opens instantly.
- Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
- Interactive programsType input into the terminal while your program runs.
- Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
- Made for learningHelpful for beginners to learn and practice programs.
- Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
- Keep your outputCopy or download the program output in one click.
- Share by linkSave your code in the cloud and open it anywhere.
Frequently asked questions
Which Pascal compiler does Online IDE use?
Free Pascal 3.2, compiling with fpc -O2 on Linux.
Can I run Turbo Pascal or Delphi code?
Most console programs can. Add {$mode tp} or {$mode delphi} at the top of the file and Free Pascal follows that dialect. Programs with windows or graphics cannot run, because the output panel shows text.
How does a Pascal program read input?
With ReadLn. Type the input in the output panel and press Enter. Text written with Write before it appears first, so a prompt shows without a flush.
Where do compiler errors appear?
In the output panel, in Free Pascal's format: the file name with the line and column in brackets, such as main.pas(7,3), then the message.
Contact us
For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.