Online C++ Compiler
Write, run, and share code snippets — no setup required.
Compile and run C++ online in your browser
A free online C++ playground and compiler. Write C++ in your browser, hit Run, and g++ compiles and executes your program in seconds. No MSVC, no CMake, no Visual Studio to set up first.
The editor is built on the same engine as VS Code, so C++ syntax highlighting, header autocompletion, and diagnostic squiggles all work. Code compiles with g++ on Alpine Linux, with the full C++ STL available — <vector>, <map>, <unordered_map>, <algorithm>, <memory>, <thread>. Good for exploring smart pointers, testing a lambda, or prepping for a C++ interview.
What makes this C++ playground useful
- Instant C++ compilation — write code, press Run, and see output from the online g++ compiler in seconds, no CMake or Visual Studio needed.
- Full C++ syntax highlighting, header autocompletion, and clear g++ compile errors, powered by the same editor engine as VS Code.
- Stdin input is supported.
std::cin >> x,std::getline(std::cin, line), andscanfall read from the playground's input box, so competitive-programming patterns and interview problems work end-to-end. No g++, clang, MSVC, or CMake on your end. - g++ compiler with the full C++ STL — vector, map, unordered_map, algorithm, and modern C++ features without setting up a toolchain.
What you can build in the C++ playground
- STL containers (vector, map, unordered_map, set) plus <algorithm> (sort, transform, accumulate). The classic interview toolkit.
- Data structures by hand — linked lists, binary trees, hash maps — plus classic algorithms (BFS, DFS, dynamic programming) with modern C++17 syntax.
- Quick C++ experiments: test a lambda, benchmark a sort, try auto type deduction, or confirm a pointer arithmetic trick without a CMake project.
Online C++ compiler FAQ
Is the online C++ compiler free?
Do I need g++ or a C++ compiler installed?
Does the C++ playground work on mobile and Chromebooks?
Does the C++ playground support std::cin and stdin?
std::cin >> n;, std::getline(std::cin, line);, and scanf all read your typed lines the same way they would when you run ./a.out locally. Good for competitive-programming problems, Codeforces-style inputs, and interview questions.