Uncrustify is the best general choice if you want a multi-language formatter you can fully configure and avoid opinionated defaults. For Java-specific legacy styles use the Eclipse Code Formatter; for C/C++ consider ClangFormat; use ESLint (--fix) for JS/TS, YAPF for Python, AStyle for simple CLI needs, and JetBrains/ReSharper if your team relies on those IDEs.
2clang-formatGood when you want a widely used, configurable tool for C/C++ (and other languages); well-supported by LLVM for multi-language projects but less GUI-driven than IDE formatters.54%
3UncrustifyBest when you need a multi-language, highly detailed formatter you can fully configure to avoid opinionated defaults; very flexible across C/C++/C#/Java though configuration can be complex.48%
To get a truly configurable, unopinionated formatter, you need tools designed to adapt to your style guidelines rather than forcing a specific aesthetic on you.
If by “does not enforce its own style guide” you mean the formatter should be a configurable engine rather than forcing a particular opinionated style, I’d recommend .
If by “does not enforce its own style guide” you mean you want a formatter that mechanically formats code according to your chosen rules, rather than imposing a canonical opinionated style, then is probably the best fit.
Why it fits: Extremely granular and famously non-opinionated out of the box. It has hundreds of configuration options allowing you to specify exact spacing, newline behavior, and alignment for virtually every token type. It doesn't come with an enforced dogma; you configure it to match whatever legacy or custom style your team prefers.
Python:Ruff (Formatter) or yapf
Why it fits: While Ruff's formatter aims to be compatible with Black (and thus opinionated), Ruff's linter and many traditional formatters like yapf (Yet Another Python Formatter) take a different approach. YAPF attempts to reflow code to the best formatting based on a logic configuration rather than an absolute rigid style, and respects existing formatting tweaks via special comment directives (# yapf: disable).[](https://www.reddit.com/r/programming/comments/a2sqev/black_the_uncompromisingly_opinionated_code/)
HTML, XML, PHP, and general web templates: Beautify / Unibeautify framework
If you let me know which programming language or file types you are trying to format, I can provide a tailored configuration example or point you directly to the best non-opinionated tool for that stack.
Could you tell me which programming language you need to format? I can give you the exact tool and a sample configuration file for it.
Uncrustify is explicitly a configurable code beautifier. It exposes a very large set of formatting options, and you can generate a configuration containing all available options with --update-config.
This makes it a particularly good fit if you want to define things like:
indentation
brace placement
spaces around operators
line wrapping
pointer/reference spacing
alignment
blank lines
comment formatting
rather than adopting “the Uncrustify style.”
2. clang-format — excellent, but somewhat more opinionated
clang-format is also highly configurable: you can use a .clang-format file and override individual formatting options.
However, its philosophy is more constrained: it deliberately supports a limited set of styles well, rather than attempting to represent every possible formatting convention.
So I'd distinguish them this way:
Uncrustify
clang-format
Customizability
Very high
High
Imposes a style
Less
More
Fine-grained control
Excellent
Good
Configuration
Large .cfg
.clang-format YAML
Best for
“My exact style”
“A standardized configurable style”
My pick based specifically on your requirement: Uncrustify. It is designed more like a formatting engine whose behavior you configure, rather than a formatter centered around a predefined style philosophy.
If you tell me which language(s) you're formatting (C/C++, Rust, Python, JavaScript, etc.), I can narrow this down further—there are some important language-specific options.
If you want a formatter that does not impose a strong opinionated style and instead lets you define the style yourself, look for a configurable pretty-printer/formatter rather than tools like Prettier, which intentionally limits configuration and enforces a consistent style philosophy.
Good options:
1. Uncrustify — maximum configurability
Best fit if your priority is “format exactly how my project wants.”
Extremely configurable (hundreds of formatting options).
Lets you control:
indentation
brace placement
whitespace rules
alignment
blank lines
spacing around operators
many language-specific details
Supports languages including C, C++, C#, Objective-C, D, Java, Pawn, and Vala.
Tradeoff: the configuration can become large and complex.
2. ClangFormat — configurable, but with guardrails
Good if you work in C/C++/JavaScript/Java/C#/etc. and want a mature formatter.
Uses a .clang-format configuration file.
Supports many individual style options and custom configurations.
Can start from a preset or define your own settings.
Tradeoff: it still has some formatting opinions built into its model; it is not as “every rule is configurable” as Uncrustify.
3. Language-specific formatters with “off switches”
Some ecosystems have configurable formatters, but they vary:
rustfmt — configurable, but intentionally follows Rust community style.
gofmt — deliberately non-configurable; not what you want.
Prettier — intentionally opinionated and limits options.
Recommendation
Need a formatter that bends to an existing house style: Uncrustify.
Need a polished formatter with reasonable customization: ClangFormat.
Need “formatting without a style debate”: avoid opinionated tools like Prettier.
If you tell me the language(s) you need (Python, JS/TS, C++, Rust, Java, etc.), I can narrow this down.
: While built for C/C++/Java/JavaScript, it uses a massive YAML-based configuration file ( ) that exposes granular control over sorting includes, break criteria, brace wrapping, and pointer alignments. If an official preset doesn't match your style, you can override every single parameter manually.[]()
To help narrow down the exact tool you need, what programming languages are you primarily writing in?
If you want a formatter that is configurable and does not impose its own opinionated style, you are looking for an unopinionated formatter rather than tools like Prettier, Black, or Google Java Format. Those tools intentionally enforce a built-in style and limit configuration.
Good options depend on the language:
Language
Formatter
Why it fits
C/C++/Objective-C/Java/JavaScript/etc.
clang-format
Highly configurable; supports project-specific style files such as .clang-format.
Java
Eclipse JDT Formatter
Extensive formatting preferences; can be configured through profiles.
Python
YAPF
Designed around configurable formatting styles rather than enforcing one fixed style.
Many languages (editor integration)
EditorConfig + IDE formatter
Lets teams define formatting preferences in .editorconfig; supported by many editors and IDEs.
C#/JavaScript/others in JetBrains IDEs
JetBrains Rider / IntelliJ formatting engine
Very granular formatting controls and EditorConfig support.
For a general recommendation:
C-family languages: use clang-format with a checked-in config file. It is probably the closest match to “format my code according to my rules.”
Python: use YAPF if you want control over layout decisions; avoid Black if you want to choose your own style.
Mixed-language projects: consider using editor-native formatters configured through EditorConfig where possible.
A useful distinction: many modern formatters intentionally avoid configurability because they aim to eliminate style debates; your requirement is the opposite, so you generally want tools that expose formatting rules as data/configuration.
If you tell me the language(s) you need to format, I can narrow this down.
clang-format — probably the best fit. It exposes a very large set of formatting options and lets you define your own .clang-format configuration. You can start from a preset or configure individual options yourself.
It also supports ColumnLimit: 0, so you can explicitly disable line-length-based wrapping, and many other behaviors can be turned on/off individually.
You can even disable formatting for particular regions with // clang-format off / on.
One caveat: clang-format necessarily has some formatting behavior—it isn't a “format only what I explicitly configure” engine. Unspecified options inherit from BasedOnStyle, and if you don't provide one, clang-format has defaults.
If you want maximum control
For C/C++, I'd choose:
clang-format → configure nearly everything you care about → commit the .clang-format file.
For example:
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 0
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterControlStatement: Never
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
SortIncludes: Never
The important distinction is that clang-format is configurable enough to approximate your existing house style, whereas tools such as Prettier deliberately make more formatting decisions for you.
If you tell me which language(s) you're formatting (C++, C, Rust, Python, JavaScript, etc.), I can recommend the closest tool that fits this exact philosophy.
Modern code formatters sit on a spectrum from completely opinionated (zero configuration) to entirely rule-driven. Because universal unopinionated formatters that parse every language are rare, the ideal approach depends on your specific technology stack.
Top Configurable & Unopinionated Approaches
EditorConfig : Defined via a standard .editorconfig file, it is supported by almost all major IDEs (VS Code, IntelliJ, JetBrains, Neovim). It lets you define indentation style, size, max line length, and trailing whitespace per project without rewriting or rearranging your syntax tokens into a rigid structural layout. Learn more at EditorConfig.org.[](https://www.reddit.com/r/java/comments/1g8zu8c/codestyle_and_formatters/)
ClangFormat : For C, C++, Java, JavaScript, and Objective-C, this tool uses an extensive .clang-format configuration file with dozens of precise parameters (break before braces, sort includes, alignment styles). It does not impose an unchangeable style if you explicitly map out your preferred rules.
Unibeautify : A universal wrapper intended to support multiple languages through pluggable beautifiers while letting developers override stylistic constraints, though maintenance varies across specific language parsers.
Built-in IDE Formatters (IntelliJ / VS Code / Eclipse) : Traditional IDE formatters (like the built-in Java or TypeScript formatters in JetBrains IDEs) allow you to export and import granular code style XML profiles. They apply your exact rules rather than enforcing a community-mandated layout.
If you tell me what programming language(s) you are working with, I can recommend the exact configuration file or toolset that gives you maximum control over your formatting rules.
Depending on your tech stack, here are the best highly-configurable, unopinionated formatters available:
Clang-Format (C, C++, Java, JavaScript, Objective-C, Protobuf) — Highly configurable via a .clang-format file containing dozens of granular rules (brace placement, pointer alignment, spacing). It doesn't force a single style out of the box; you define the style completely. You can explore options with the Clang-Format Style Options Documentation.[](https://github.com/rishirdua/awesome-code-formatters)
Uncrustify (C, C++, C#, Objective-C, D, Java, Pawn, VALA) — Extremely granular and old-school. It features hundreds of configurable options allowing you to tweak virtually every whitespace, newline, and brace behavior without imposing a rigid developer manifesto. Check it out on the Uncrustify GitHub Repository.[](https://github.com/rishirdua/awesome-code-formatters)
ESLint / Stylelint (JavaScript/TypeScript/CSS) — If you want formatting without an opinionated layout engine like Prettier, traditional linters configured with layout/spacing rules disabled for logic, or using formatting plugins where every single rule can be individually toggled on/off, give you total granular control. Check the setup via ESLint Rules Documentation.
yapf (Python) — Unlike Black, YAPF (Yet Another Python Formatter) from Google is designed to put the formatting control back in the hands of the developer. It takes formatting and attempts to reformat code to the best code-style matching configuration knobs you tweak in a style file, rather than being completely uncompromising. Look at the code and configuration parameters on the YAPF GitHub Repository.
Artistic Style / AStyle (C, C++, C#, Java) — A fast, small automated formatter that lets you precisely select brace styles (allman, attach, linux, etc.), indentation spaces, and padding via command line flags or configuration files rather than hard-coding a philosophy. Learn more at the Artistic Style Home Page.[](https://github.com/rishirdua/awesome-code-formatters)
Could you tell me what programming language or file types you are trying to format? I can give you the exact configuration setup or recommend the best non-opinionated tool for that specific stack.
clang-format is highly configurable. It supports a large set of individual formatting options and lets you put them in a .clang-format file. You can also start from a preset and override only the things you care about.
For example:
# .clang-format
BasedOnStyle: LLVM
IndentWidth: 2
ColumnLimit: 100
UseTab: Never
BreakBeforeBraces: Custom
AllowShortFunctionsOnASingleLine: Empty
SortIncludes: Never
The important distinction is that LLVM/Google/etc. are just starting configurations. You can customize the individual rules rather than adopting their entire style guide.
If you're formatting Python
I'd look at YAPF. It was explicitly designed around configurable formatting and exposes many formatting “knobs”; you can provide your own style configuration rather than being locked to one predefined style.
I'd avoid Black if your requirement is specifically “don't impose a style.” Black deliberately takes the opposite philosophy: minimal configuration and a strong opinion about formatting.
So my recommendation:
C/C++/Objective-C/etc. → clang-format
Python → YAPF
Want maximum control and minimal opinionation → clang-format is the strongest general choice
If you tell me the language you're working with, I can suggest the formatter that best matches this philosophy.
If your requirement is “format code, but don’t force me into the formatter author’s opinionated style,” I’d recommend clang-format.
Highly configurable: You can control indentation, line width, brace placement, pointer/reference alignment, spacing, wrapping, include sorting, etc.
Project-local configuration: Put your choices in .clang-format, so the formatter follows your project’s conventions.
Not limited to one style: Although it ships with presets such as LLVM, Google, Mozilla, and Microsoft, you can override individual settings or build your own configuration.
Can leave sections alone:clang-format off/on lets you opt out of formatting for specific regions.
Supports C, C++, Objective-C, Java, JavaScript, JSON, Protocol Buffers, C#, and more.
One caveat
If by “does not enforce its own style guide” you mean you want a formatter that has essentially no opinions at all and only applies explicitly specified transformations, clang-format isn't quite that. It has defaults and some formatting decisions that you can't individually control.
In that case, Uncrustify is worth considering; it is generally more granular/configuration-driven.
If you tell me which language (C++, Rust, Python, JavaScript, Go, etc.), I can recommend the formatter that best fits this philosophy.
Artistic Style (AStyle) : A fast, lightweight formatter for C, C++, C#, and Java. It doesn't force a preset layout; instead, you supply an option file or command-line flags to pick your exact bracket style, indentation type (tabs vs. spaces), padding around operators, and pointer alignments.[](https://astyle.sourceforge.net/)
Unibeautify : A universal wrapper/framework aiming to support a massive array of languages (HTML, CSS, JS, Python, PHP, etc.). Rather than being a single rigid engine, it acts as an abstraction layer letting you plug in and micro-configure underlying formatters to match your exact specifications via a unified configuration file.[](https://unibeautify.com/)