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.

Blog posts have the tendency to rarely be updated with fresh information. Therefore, the essence of this post is available in a more up-to-date GitHub page with more compilers. If you find a compiler that’s not on the list please leave a pull request or issue on the GitHub project. The GitHub list will also leave out a few paragraphs that are purely personal opinions. Kudos also to Adi Shavit who made a huge contribution to give that page a better look.

List of online C++ 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.

Wandbox

URL http://melpon.org/wandbox Compilers GCC 4.4.7 .. 8.0.0 (HEAD)

Clang 3.1 .. 5.0.0 (HEAD)

zapcc 1.0.1 C++ version C++17* Compiler flags dropdown selection + free text Runtime parameters yes Stdin yes

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.

I have used Wandbox extensively in the last months, especially to verify code samples from a C++17 book that I had the pleasure to review. Since it has HEAD revisions of both Clang and GCC available, almost every of the C++17 features I tested did compile. Therefore, Wandbox is currently my go-to online compiler when I want to execute the compiled program.

Compiler Explorer (Godbolt)

URL http://godbolt.org Compilers GCC 4.4.7 .. 8.0.0 (snapshot)

Clang 3.0 .. 5.0.0 (trunk)

MSVC 19/2017 (x86, x64)

icc 13, 16, 17

zapcc 190308

PowerPC gcc 4.8, PowerPC 64 6.3.0

MSP430 gcc 4.5.3 .. 6.2.1

MIPS gcc 5.4 (32/64 bit, el)

elcc 0.1.33, 0.1.34

AVR gcc 4.5.4, 4.6.4

ARM64 gcc 5.4

ARM gcc 4.5.4 .. 5.4.1

ARM CL 2017 RTW C++ Version C++17* Compiler flags free text Runtime parameters N/A Stdin N/A

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.

I am continuously amazed by this tool and it’s ease of use. The almost instant compilation, while you type, give the immediate feedback you usually only get from large IDEs. I used Compiler Explorer a lot lately to play around with compile time calculations and to reproduce and reduce a compiler bug or two. It is no wonder that “godbolting some code” has become a term used in certain circles.

Coliru

URL http://coliru.stacked-crooked.com Compilers GCC 4.6 .. 7.1

Clang 3.8 C++ Version C++17* Compiler flags free text Runtime parameters free text Stdin via linux shell pipe

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.

Directly after Wandbox, Coliru is the other compiler I use to execute C++ code online. The slightly less up-to-date compilers and the awkward way you have to deal with multiple files if you need them make it inferior to Wandbox in my opinion. However, if these two points are not an issue for you, the free parametrization via the shell commands is a big plus.

Rextester

URL http://rextester.com/ Compilers GCC 5.4.0

Clang 3.8.0

MSVC 19/2017 C++ Version C++14 Compiler flags free text Runtime parameters none Stdin yes

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

URL https://ideone.com/ Compilers GCC 6.3.0 C++ Version C++14 Compiler flags fixed Runtime parameters none Stdin yes

Ideone is a standard online IDE that allows to edit, compile, execute and share single C++ files.

Visual C++ Compiler Online

URL http://webcompiler.cloudapp.net/ Compilers MSVC 19/2017 (x86) C++ Version C++14 Compiler flags reduced set Runtime parameters yes Stdin no

Microsoft’s showcase for its most up-to-date compiler. It allows single file compilation, running the executable after compilation is optional.

Update: This online compiler seems to have been offline for some time now.

C++ Shell

URL http://cpp.sh/ Compilers GCC 4.9.2 C++ Version C++11, partially C++14 Compiler flags reduced set Runtime parameters no Stdin static or interactive

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.

Tutorialspoint CodingGround

URL https://www.tutorialspoint.com/compile_cpp11_online.php Compilers GCC 4.8.5 C++ Version C++11 Compiler flags yes Runtime parameters no Stdin yes

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).

Codepad

URL http://codepad.org/ Compilers GCC 4.1.2 C++ Version C++03 Compiler flags fixed Runtime parameters no Stdin no

Codepad can be unintuitive – pasting new code at theURLof 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.

LoopPerfect C++ Fiddle

URL http://fiddle.jyt.io/ Compilers unknown C++ Version unknown Compiler flags N/A Runtime parameters N/A Stdin N/A

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.

Conclusion

With the triplet of Wandbox, Compiler Explorer and Coliru there is not much left to want from online compilers. The Tutorialspoint online IDE is an honorable mention as it might feel like a good idea. However, in my opinion, it’s overkill and the sluggish performance of the web app does not make up for fancy features you’d rarely need for one-off code snippets.