Online Prolog Compiler & Editor

Online Prolog Compiler · Examples & offline guide

Online Prolog Compiler & Editor

Write, edit, and run Prolog code directly in your browser with local execution and automatically saved drafts. Use this free Prolog online editor to practice programs without installing software, then keep coding offline after the editor and runtime show “Available offline”.

Practice Prolog (SWI-Prolog) programs in this playground

Use this Prolog playground to experiment with the starter example, practice language syntax, and check program output. The bundled runtime is SWI-Prolog 10.1.15 · swipl-wasm 8.2.0. Check the limits below before using additional packages or platform features.

How to run Prolog (SWI-Prolog) online

Edit the starter program, choose Run, and read the output. No account or installation is required. Execution uses SWI-Prolog 10.1.15 · swipl-wasm 8.2.0 on your device.

Prolog (SWI-Prolog) example program

parent(ada, grace).
parent(grace, alan).
ancestor(X, Y) :- parent(X, Y).
ancestor(X, Y) :- parent(X, Z), ancestor(Z, Y).

?- ancestor(ada, Who).

Questions about this editor

How do I use this Prolog online editor?

Start with the example or write your own Prolog program, choose Run, and view the output. BrowserCode uses SWI-Prolog 10.1.15 · swipl-wasm 8.2.0 for local execution in your browser. The playground is free and does not require an account.

Can I run Prolog online without installing a compiler or interpreter?

Yes. This browser-based Prolog playground loads the bundled SWI-Prolog 10.1.15 · swipl-wasm 8.2.0 runtime for you. Edit a program and choose Run to test it locally. The supported features and limitations are listed below.

Can I use this Prolog editor offline?

Yes. Open this language while connected and wait for “Available offline” before disconnecting. The editor and language runtime must finish saving to browser storage. You can then edit and run code offline in this browser. Clearing site data or browser storage eviction removes saved downloads. Optional cloud sync and AI need internet access.

What are the limits of running Prolog in a browser?

Full SWI-Prolog engine and bundled standard library. End the file with one ?- query; up to 100 solutions are shown. Browser filesystem is temporary; native processes, network access and interactive input are unavailable.

Is my code private and saved?

Code execution and free drafts stay on your device. Drafts are saved in this browser; download files to keep a separate copy. Optional paid Supporter cloud sync and AI send the work or context you choose to share and require an internet connection.