Skip to content

clang-format playground

Paste C or C++ code, pick an LLVM version and a style, and see what clang-format changes. clang-format runs in your browser as WebAssembly, so your code is not sent anywhere.

What clang-format changes

Loading clang-format…

Run the same check

These use the version and style picked above.

On your machine, with clang-tools

    
Before every commit, in .pre-commit-config.yaml with cpp-linter-hooks

    
On every pull request, with cpp-linter-action

    

The WebAssembly builds of clang-format come from the @wasm-fmt/clang-format npm package and are loaded from jsDelivr when you open this page. Their patch release can differ from the one cpp-linter installs for the same LLVM version. The playground has no clang-tidy: it needs the compile flags and headers of a real build.