Skip to content
SPECIFICTION
Get listed

clang-format vs Prettier

clang-format

clang.llvm.org

Prettier

prettier.io

Side by side

Figureclang-formatPrettier
Price from—Free
Free plan—Yes
Free trial——
Open source—Yes
Web—Yes
WindowsYesYes
macOSYesYes
LinuxYesYes
API—Yes
Self-hosted—Yes
Plans published02
Spec score · Code formatters7.7 (#8)8.5 (#2)
Spec score · Code Formatting Tools7.6 (#20)8.5 (#2)
ConfigurationFormatting styles can be set with command-line options or project-level .clang-format or _clang-format files.Configuration can use JSON, YAML, TOML, JavaScript or TypeScript files, with overrides for selected files and directories.
Editor integrationsThe documentation describes integrations for Vim, Emacs, BBEdit, CLion, Visual Studio, and Visual Studio Code.The official site lists integrations or support for VS Code, WebStorm, Visual Studio, Vim, Emacs, Sublime Text, Nova and Espresso.
LanguagesThe standalone tool formats C, C++, Java, JavaScript, JSON, Objective-C, Protobuf, and C# code.Built-in language support includes JavaScript, JSX, Angular, Vue, Flow, TypeScript, CSS, Less, SCSS, HTML, JSON, GraphQL, Markdown, YAML, LWC, and MJML.

Plans

clang-format

No plans published.

clang-format pricing →

Prettier

  • Open-source PrettierFree
  • PrettierFree

Prettier pricing →

In their own words

clang-format

clang-format has no write-up on Specifiction yet; its figures are above.

Visit clang.llvm.org

Prettier

Prettier is an open-source code formatter that parses source files and prints them in a consistent style while accounting for line length. Its built-in languages include JavaScript, JSX, Angular, Vue, Flow, TypeScript, CSS, Less, SCSS, HTML, JSON, GraphQL, Markdown, YAML, LWC, and MJML. The command-line interface can write formatted files with --write or check formatting with --check in continuous integration. Listed editor integrations include VS Code, Emacs, Vim, Helix, Sublime Text, JetBrains IDEs, Visual Studio, and Espresso; formatting can run from a shortcut or on save. Prettier has configuration options but keeps them limited. Plugins can add languages and formatting rules, and languages outside the built-in set require a plugin. For ESLint integration, the installation guidance recommends eslint-config-prettier to disable rules that are unnecessary or may conflict. Prettier supports browser and JavaScript API use, along with Linux, macOS, and Windows. The listed plan is free. Commercial support and maintenance are available through the Tidelift Subscription.

Visit prettier.io