C / C++ Formatter
Reformat C or C++ source — brace style, indent width, and preprocessor placement controls.
How to use
- 1 Pick C or C++.
- 2 Paste source.
- 3 Pick brace style, indent size, and where preprocessor lines should sit.
- 4 Copy or download the result.
Why use this tool
- Astyle-equivalent rule set: braces, indent, preprocessor placement.
- Preprocessor lines can stay at column 0 or follow nesting — your call.
- Pure client-side — your code never leaves the browser.
- For canonical output use clang-format locally with your .clang-format file.
Frequently asked questions
Does this match clang-format?
Approximate — we apply indent and brace style only. clang-format also handles pointer alignment, column-limit wrapping, and access-modifier indent. Use clang-format locally for canonical output.
C vs C++ — what changes?
The rule set is shared. The toggle controls which sample we load and which extension the download uses.
Will it preserve my macros?
Macro definitions on preprocessor lines are kept verbatim. Multi-line macros with trailing backslash are kept on consecutive lines but each is treated as one preprocessor line.
C / C++ Formatter is a free developer utility by Zerethon Tools. Reformat C or C++ source — brace style, indent width, and preprocessor placement controls. Runs entirely in the browser — no signup, no upload.
- Category
- Developer
- Pricing
- Free
- Privacy
- Browser-based
- Signup
- Not required
Privacy
Your data never leaves your browser unless explicitly stated. C / C++ Formatter runs entirely client-side — no server upload, no logging, no tracking of your input.
Related tools
JSON Formatter
Format, validate, and minify JSON online. Free, no signup — your data never leaves your browser.
Open toolSQL Formatter
Format SQL queries online — beautify MySQL, PostgreSQL, SQLite, SQL Server, Oracle, and BigQuery.
Open toolUUID Generator
Generate UUIDs online — v1, v4, v7, and Nil. Bulk generation up to 10,000. Free, no signup.
Open toolPassword Generator
Generate strong, cryptographically random passwords. Configurable length and character sets — runs in your browser.
Open toolBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.