Online compilers can be useful tools to quickly compile a snippet of code without having to install a proper compiler on our computer. They can be especially useful to play with the newest language features, to share code snippets online or to compare different compilers.
The following list provides information about available online compilers and their most important features. Support for other languages than C++ is available on many of the listed websites but not covered here. Depending on the versions of the compilers used, they support different versions of the C++ standard. See this page for more detailed feature lists. Since C++17 is not fully standardized yet, it is marked with an asterisk, where (most of) the expected C++17 features are available.
Besides mere compilation, most online compilers also execute the compiled program. The possibilities to parametrize the compilation via compiler flags, to pass command line/runtime parameters to the executed program and to provide input for standard input vary between the different compilers.
- Table of Contents {:toc}
Name | Number Compilers | C++ Version | Boost Version | Execution | Distinguishing Features | Other Languages |
---|---|---|---|---|---|---|
paiza.IO | 1 | C++14 | ✔️ | multiple files, collaborative live editing, full screen editor, Internet connection, GitHub(gist) integration | ✔️ | |
Wandbox | 35 | C++17 | 1.64 | ✔️ | multiple files | ✔️ |
Compiler Explorer (Godbolt) | 60+ | C++17 | 1.64 | compile to assembly as you type, on multiple compilers | ✔️ | |
Coliru | 2 | C++17 | 1.63 (header only) | ✔️ | GCC & Clang, freely editable shell command line | |
Quick-Bench | 1 | C++17 | only benchmarks | benchmarks functions against each other | ||
Rextester | 3 | C++14 | 1.58 (header only) | ✔️ | GCC, Clang, MSVC, collaborative live editing features | ✔️ |
Ideone | 1 | C++14 | 1.62 (header only) | ✔️ | GCC | ✔️ |
Visual C++ Compiler Online | 1 | C++14-17 | ✔️ | up-to-date MSVC 19/2017 | ||
C++ Shell | 1 | C++11-14 | 1.55 (header only) | ✔️ | GCC, interactive Stdin | |
repl.it | 1 | C++17 | ✔️ | GCC, interactive Stdin | ✔️ | |
Tutorialspoint CodingGround | 1 | C++11 | ✔️ | multiple files like proper IDE, GCC but sluggish web app |
||
Geeksforgeeks | 1 | C++14 | 1.58 | ✔️ | GCC, full screen editor | ✔️ |
Codepad | 1 | C++03 | 1.34 | ✔️ | GCC | ✔️ |
TIO - Try It Online | 1 | C++14 | ✔️ | Easy sharing, split source in header, source and footer | ✔️ | |
LoopPerfect C++ Fiddle | interactive C++ interpreter/terminal, but currently broken |
paiza.IO is a full screen online IDE that allows to edit, compile, execute and share multiple C++ files. As a distinguishing feature, it allows live editing, multiple file editing, Internet connection, and GitHub(gist) integration.
Wandbox provides pretty much all of the functionality you'd want from a typical online compiler, including support for multiple files and different editor keybindings. Besides the standard library, it features a few libraries including Boost (up to 1.64), Sprout and MessagePack. The compiled programs run in a sandbox environment that allows file I/O. The snapshot versions of GCC and Clang that are provided make it possible to play with the latest C++17 features.
Compiler Explorer is a compile-as-you-type IDE with a unique feature as it presents the assembly produced by the compilers. The resulting assembler can be color-mapped to the originating C++ code. It supports the use of different sources and multiple compilers at the same time, so we can compare the assembly produced by different code and/or different compilers, optimization flags, etc. Compiler explorer can be found on GitHub and can be used locally. Currently, the compiled code can not be executed, but there is an open GitHub issue for this feature.
Coliru provides an editor and a freely editable Linux shell command line, which makes it relatively powerful. For example, you can compare the outputs of both Clang and GCC by issuing the commands for compilation and execution for both compilers. Editing of multiple files at once is not supported, but since the code you share is saved in an archive you can use that to prepare multiple files (see the FAQ for an example). It is also possible to download e.g. a Gist via curl
before the compilation.
Coliru provides a public API, so it can, for example, be integrated into websites cppreference.com, which uses Coliru for its runnable examples.
Quick-Bench is specialized for benchmarking snippets of C++ code. It relies on Google Benchmark and, instead of showing your code's console output, it shows how fast it executed compared to an empty function.
Rextester is a standard online IDE that allows to edit, compile, execute and share single C++ files. As a distinguishing feature, it allows creating live editing sessions so that multiple people can edit the same source simultaneously and see each other's edits in real time.
Ideone is a standard online IDE that allows to edit, compile, execute and share single C++ files.
Microsoft's showcase for its most up-to-date compiler. It allows single file compilation, running the executable after compilation is optional.
Another single file compilation IDE, but with the rare feature of interactive stdin input. The web application seems to hang sometimes during compilation or execution.
A single file compilation IDE, but comes with a shell-like interactive stdin input. Users that have logged in can save multiple named sessions (but no multi-file compilation). While the prompt says something about gcc 4.6.3, it uses gcc 7.1.0.
An online IDE with multiple files. The whole web application seems to be sluggish at times, I could not register to try out the features that require an account login like saving or uploading whole projects (broken link/unresponsive web app).
Geeksforgeeks is a classic online compiler for several languages. Notable features are a full screen mode for the editor and "Copy" buttons on every textbox (editor, stdin, stdout, sharing link) that put the content in the clipboard.
TIO has a slightly unusual interface but elsewise provides any functionality you'd expect from an online compiler. A notable feature is that you can split your code into a header, a footer and a main source, e.g. to get includes and boilerplate out of the focus of the reader. Another is that TIO preformats sharing links for various targets, e.g. http links, Wiki links, BBCode links and even a full post for Codegolf StackExchange. The post will contain only the main source but not the header and footer code.
Codepad can be unintuitive - pasting new code at the URL of previously pasted code will return to the original code. The code will be compiled and executed as-is without any possibility to further parametrize it.
C++ Fiddle claims to be an interactive C++ interpreter/terminal but seems to be broken, or the interface is so non-obvious that is should be considered broken.