COBOL · online compiler

Run COBOL online

Run COBOL online — GnuCOBOL 3, browser-hosted, no mainframe required.

Available versions
Firecracker microVM live per-test verdicts multi-file compile

COBOL runs more of the world's financial infrastructure than any developer under 40 would guess. The maintenance market is huge, the training market is tiny, and the language is legitimately interesting once you get past the columns.

ls-judge runs GnuCOBOL 3, a modern free COBOL compiler that reads standard OpenCOBOL/COBOL-85 sources and produces native binaries. Each submission compiles and runs inside its own microVM.

Starter code

What you get in COBOL

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

cobol
COBOL 3.7
IDENTIFICATION DIVISION.
PROGRAM-ID. solution.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 N PIC 9(9).
01 R PIC 9(9).
PROCEDURE DIVISION.
    ACCEPT N
    COMPUTE R = N * 2
    DISPLAY R
    STOP RUN.
stdin →21
expected →000000042
FAQ

Common questions about COBOL on ls-judge

Which COBOL standard?
GnuCOBOL 3 accepts COBOL-85, COBOL-2002 and COBOL-2014 features via -std flags; the default is a permissive superset.
Fixed-format or free-format?
Fixed-format by default (columns 1-6 sequence, 7 indicator, 8-11 area A, 12-72 area B). Free-format is selectable.
Can I run CICS / DB2 code?
No — those are mainframe subsystems. Pure batch COBOL works.
Free to use?
Yes.
Further reading
Also try